# Flash EPOCH vs PHP EPOCH

**URL:** <https://forum.kirupa.com/t/flash-epoch-vs-php-epoch/327304>\
**Category:** flash\
**Created:** [February 20, 2012, 7:23pm UTC](https://forum.kirupa.com/t/flash-epoch-vs-php-epoch/327304 "2012-02-20T19:23:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esseti](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@Esseti](https://forum.kirupa.com/u/Esseti)\
**Post date:** [February 20, 2012, 7:23pm UTC](https://forum.kirupa.com/t/flash-epoch-vs-php-epoch/327304/1 "2012-02-20T19:23:59Z")

</div>

I’m having a problem in calculating the current time from the PHP epoch result, vs the epoch of the user. Here’s a link: [http://malylink.pdg.pl/epoch/test.html](http://malylink.pdg.pl/epoch/test.html)  
I always get +~22 minutes when I calculate the server epoch, vs my local one. I know that the PHP epoch returns seconds, and Flash returns miliseconds, so I’ve corrected in the code.  
Why am I getting this inconsistency? Is it because of PHP’s seconds instead of milisecond value returned?

Please note, that the server is located in Poland, so its GMT +1.

Oh, and why do I need this? I’m writing a simple countdown clock, and I want it to be synced with the server time, so that the users can’t cheat it.

I’ve attached a simple example of the code, but you need to run it either on your localhost or on a server.
