1

In chrome developer tools in console following line:

JSON.stringify(new Date(2018,0,1,0,0,0,0))

gives this output:

""2017-12-31T23:00:00.000Z""

but this line:

JSON.stringify(new Date(1800,0,1,0,0,0,0))

gives

""1799-12-31T22:36:00.000Z""

Why is so? I live in central Europe so i understand 1 hour saving time shift (winter time) but why also 24 minutes in second case?

Kamil
  • 13
  • 1
  • 3
  • 1
    It is a recent update designed to better reflect historical time. There was no such thing as a "time zone" back in 1799. – Pointy Jun 17 '18 at 13:14
  • Also it doesn't have anything at all to do with `JSON.stringify()`. It's behavior of the Date API. – Pointy Jun 17 '18 at 13:17

0 Answers0