Well, not sure whats going on. I have been trying to follow by examples I have found here on stack, on google, even an answer someone gave me a week+ ago, which unfortunately I wasn’t able to test until today.
Anyway I am attempting to generate a javascript friendly timestamp via php so I can get my times synced up. The best logic I could find overall was something dealing with microtime. However that doesn’t seem to work as expected, not even in the slightest.
Right now I am using microtime(true)*1000; and am getting 1.34899651119E+12 for the result. Did I some how manage to mess up that one tiny line of code, Im not sure.
I should mention that I also tried round(microtime(true) * 1000); which gave very similar results.
Your code is returning
1349000021801.4to me (PHP 5.3.15 on Linux 3.4.6 x86_64).To be on the safe side I’d bite the bullet and manipulate the microtime differently:
When you output this string to Javascript, it will contain a “clean” integer.