How does the Date in js specify the translation time zone?

for example, now x = 1526559600000
Date (x) returns Beijing time UTC+8 time zone time, when in fact this is a UTC+0 time zone time. Please take a look at

.
Mar.12,2021

1. Timestamp
let timestamp = Date.now ();
ask a question, does running this line of code in different time zones return the same value? The answer is the same. The timestamp of
JS refers to the number of milliseconds from a place from a previous point to the present.
if you are in Greenwich, your start time is 01 00 minutes and 00 seconds on January 1, 1970.
if you are in Beijing, China, your starting time is 08 on January 1, 1970.

so, the timestamp is without time zone information.

put it more clearly.
I got the timestamp in Beijing: let timestamp = Date.now ();
while you use this timestamp to generate a time object new Date (timestamp) in the United States, it is 12 hours slower than me.

2. Conversion time
Local time minus the difference between the local time and the time zone of the target location, which has nothing to do with the timestamp.


https://blog.csdn.net/u012193.


you x minus the 8-hour timestamp


npm install moment

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3831d-2c0fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3831d-2c0fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?