Safari (Mac OS X Lion) returns the wrong time value at position.timestamp

I am creating a website that uses the W3C Geolocation API and position.timestamp to timestamp. I tested it on Safari 5.1.6 (Mac OS X Lion) and iPhone (5.x). By default, iPhone returns the correct value for the timestamp, but Safari does not. Does anyone encounter a similar problem? Is there a bug in Safari?

Test it here: http://jsfiddle.net/vRRdE/2/

Running the test above (thanks Tyilo) I get 360419807893 (incorrect with position.timestamp ) and 1338727007910 (fix one with Date().getTime() ) using Safari on Mac OS X.

+7
source share
1 answer

It seems that the Safari desktop uses January 1, 2001 as the default era, so the best approach here is probably just using Date (). getTime ();

+3
source

All Articles