here is the following code snippet:
date2 = new Date(1518, 8, 6, 0, 0, 0, 0);
console.log(date2);
which I expect to return:
1518-09-06T00:00:00.000Z
but instead of, the console.log returns:
1518-09-05T22:43:40.000Z
What am I missing here?
EDIT: It seems, the problem is related to node.js, the problem occured when I run the code with node.
If I run it in Chrome Dev Tools console, the result is as expected:
Fri Sep 06 1518 00:00:00 GMT+0116 (Central European Summer Time)