JavaScript 从哪里获取新的 Date() [英] Where does JavaScript get a new Date() from
问题描述
JavaScript 从哪里获得新的 Date()?
Where does JavaScript get a new Date() from?
是基于客户端本地计算机的时间设置还是其他什么?
Is it based on the client's local computers time settings or something else?
我找不到任何记录的地方.https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
I can't find anywhere only where this is documented. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
推荐答案
鉴于您不需要互联网连接即可使用 JavaScript,它会获取当前日期 &来自客户端本地环境的时间(以及通过代理,UTC 偏移量/区域设置).您可以通过更改本地时钟来测试这一点.
Given you don't need an internet connection to use JavaScript, it gets the current date & time (and by proxy, the UTC offset/locale) from the client's local environment. You can test this by changing your local clock.
记得把它改回来..:)
Just remember to change it back..:)
这篇关于JavaScript 从哪里获取新的 Date()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!