'Did new Date().getTime() returns utc milliseconds? [duplicate]

new Date().getTime() // returns same utc milliseconds for all system time zones

So, is new Date().getTime() returns utc milliseconds?



Solution 1:[1]

There is no such things as "UTC milliseconds". A millisecond is an SI unit that is one thousandth of a second.

ECMAScript Date instances hold a time value that is an offset in milliseconds from 1970-01-01T00:00:00Z (the ECMAScript epoch). As a consequence, Dates are considered to be UTC, but that's just a concept based on the underlying time value.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RobG