runthis Posted January 3, 2012 Posted January 3, 2012 Ok, so my question is this. How can i convert a php timestamp time() to javascripts new Date function. The reason is because, new Date gives the users time. Php gives the server time. The server time is what i want. I understand i could rewrite my entire timing system in javascript to the timezone the server is in, but maybe you know the way without rewriting my javascript functions completely when the server changes Quote
bineye Posted January 3, 2012 Posted January 3, 2012 ok why is the time * 1000? does the JS need this for it to work? Quote
bluegman991 Posted January 4, 2012 Posted January 4, 2012 Javascript time is in microseconds. Php time defaults to seconds. If you want to be more accurate you can use microtime(true)*1000. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.