I am creating a website that uses W3C Geolocation API and position.timestamp for timestamp. I have tested it on Safari 5.1.6 (Mac OS X Lion) and iPhone (5.x). iPhone default browser returns correct value for timestamp, while Safari does not. Has anyone experience similar issue? Is there a bug in Safari?
Test it here: http://jsfiddle.net/vRRdE/2/
Running the test above (thanks Tyilo) I get 360419807893
(wrong one using position.timestamp
) and 1338727007910
(correct one using Date().getTime()
) using Safari on Mac OS X.
It seems that desktop Safari uses January 1, 2001 as the default epoch so the best approach here is probably just using Date().getTime();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With