JavaScript date constructor and timezone

The Date constructor in JavaScript / ECMAScript / JScript allows you to pass the number of milliseconds since midnight, 1/1/1970. Nowhere can I find documentation, be it midnight in the time zone of the client machine or midnight GMT. What he? Can I use different browsers and versions? Is it officially registered somewhere?

+3
source share
1 answer

From the ECMAScript specification :

Time is measured in ECMAScript in milliseconds since January 01, 1970. UNIVERSAL GLOBAL TIME. In time values, second jumps are ignored. It is estimated that there are exactly 86.4 million milliseconds per day. ECMAScript number values โ€‹โ€‹can be integers from -9,007,199,254,740,991 9.007.199.254.740.991; this range is enough to measure time to millisecond accuracy for any moment that is, within about 285,616 years, forward or backward, from January 01, 1970.

The actual time range supported by ECMAScript Date objects are slightly smaller: exactly -100,000,000 days to 100,000,000 days, measured relative to midnight at the beginning of January 01, 1970 UTC. This gives a range of 8,640,000,000,000,000 milliseconds on either side of January 1, 1970. UNIVERSAL GLOBAL TIME.

01 1970 . UTC +0.

, , .

+6

Source: https://habr.com/ru/post/1731397/


All Articles