我无法找到 JavaScript Date()
方法的源代码。
- 是来自最终用户 PC 的时间吗?
- 它来自全局时间服务器吗?
最佳答案
When Date is called as a function rather than as a constructor, it returns a String representing the current time (UTC).
此外,如果您将 Date
函数作为构造函数调用,it says :
...the time value (UTC) identifying the current time
因此,在这两种情况下,规范都表示“当前时间”。如何确定“当前时间”取决于实现者(即浏览器),但它通常由其运行的设备上的时间驱动。
关于javascript - Date() 的时间源是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37182036/