Flash EPOCH vs PHP EPOCH

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
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.