I'm writing a simple javascript to calculate the time difference between server and user time. But something is going wrong.
If I catch the javascript and php date i have:
date("M d Y h:i:s A")
php date : Wed Jun 27 2012 04:10:41 AM
new Date()
J S date : Wed Jun 27 2012 10:10:40 GMT+0200 (CEST)
This is correct! I have two different time for local and server time.
Now if I take the seconds time... something goes wrong:
(php: date("U"))
sec PHP: 1340784640
(js new Date().getTime()/1000 )
sec J S: 1340784640
I got the same time!
Can you help me to fix it ?
Thanks!