0

Can somebody explain why parsing a date results in different dates in Chrome and Firefox...? I must misunderstand something...?!?

// this js line gives a different result in Chrome than in Firefox:
alert(new Date('2016-01-01T00:00:00'));

Chrome: Fri Jan 01 2016 01:00:00 GMT+0100 (Central Europe Standard Time)

Firefox: Fri Jan 01 2016 00:00:00 GMT+0100 (W. Europe Standard Time)

JSFiddle: https://jsfiddle.net/adnd48zo/1/

Mcanic
  • 1,304
  • 16
  • 22

1 Answers1

0

When setting a date without specifying the time zone, JavaScript will use the browser's time zone.

Chava Geldzahler
  • 3,605
  • 1
  • 18
  • 32