Safari (Mac OS X Lion) returns wrong epochtime value to position.timestamp call

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.


似乎桌面Safari使用2001年1月1日作为默认纪元,所以这里最好的方法可能就是使用Date().getTime();

链接地址: http://www.djcxy.com/p/10816.html

上一篇: 如何让编辑器在Virtualtreeview中保持活跃?

下一篇: Safari(Mac OS X Lion)将错误的epochtime值返回给position.timestamp调用