time - JavaScript 日期构造函数和时区

标签 time timezone javascript ecma262

JavaScript/ECMAScript/JScript 中的 Date 构造函数允许传递自 1970 年 1 月 1 日午夜以来的毫秒数。无论是客户端计算机时区的午夜,还是格林威治标准时间的午夜,我都找不到文档。是哪个?不同浏览器和版本之间可以依赖吗?这在任何地方都有正式记录吗?

最佳答案

来自ECMAScript specification :

Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC. In time values leap seconds are ignored. It is assumed that there are exactly 86,400,000 milliseconds per day. ECMAScript Number values can represent all integers from –9,007,199,254,740,991 to 9,007,199,254,740,991; this range suffices to measure times to millisecond precision for any instant that is within approximately 285,616 years, either forward or backward, from 01 January, 1970 UTC.

The actual range of times supported by ECMAScript Date objects is slightly smaller: exactly –100,000,000 days to 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC. This gives a range of 8,640,000,000,000,000 milliseconds to either side of 01 January, 1970 UTC.

The exact moment of midnight at the beginning of 01 January, 1970 UTC is represented by the value +0.

所以要回答你的问题,它是 Coordinated Universal Time .

关于time - JavaScript 日期构造函数和时区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2200582/

相关文章:

javascript - 我可以将 OpenLayers 用于简单的自定义图 block 网格系统吗?

javascript - 如何给galleria big image加边框?

time - Lua 程序延迟

javascript 一次性实现更多功能

Java TimeZoneUpdater 因 java.io.EOFException 崩溃

javascript - 本地计算机与 travis.ci 返回 `Date.toISOString()` 的不同结果

javascript - child 里面 Angular child

python - 如果时间戳 20160322T192202 不以 'Z' 结尾,那么 T 意味着什么?

time - Android:日历不给出全年数字,只给出 111 而不是 2011

java - hibernate 和 MySQL 的时区问题