Important notes:
- The machine's date & time setting is the automatic setting
- The machine is located in Malaysia, and the timezone is GMT +8
- Malaysia do not have daylight saving
Question:
When using the Date
constructor with the number value which representing the number of milliseconds since January 1, 1970, 00:00:00 UTC.
These two numbers (378000000000
, 379000000000
) are giving different timezone.
This was tested in both Chrome devtool console and node.js, they're giving the same result. Came across this post but it doesn't seems relevant.
Any clue / explanation please?
Below is the quick snippet and the screenshot of result
console.log(new Date(378000000000).toString());
console.log(new Date(378000000000).toLocaleString());
console.log('-----------');
console.log(new Date(379000000000).toString());
console.log(new Date(379000000000).toLocaleString());