-1

I am in London (GMT time zone). We are currently in DST.

In the UK, Daylight Saving Time starts in March and ends in October, so Jan 1 1970 would have been outside DST.

However,

epochDate = new Date(0);
console.log(epochDate);

returns

Thu Jan 01 1970 01:00:00 GMT+0100 (Greenwich Mean Time)

I expected

Thu Jan 01 1970 00:00:00 GMT+0000 (Greenwich Mean Time)

Does Date(); return results in the current timezone?!

AlanQ
  • 91
  • 1
  • 12
  • 2
    Internally Date values are *always* based on UTC (GMT). The "conversion" to local time happens when the Date is converted to a string. – Pointy Apr 23 '22 at 16:22

1 Answers1

4

JavaScript Date(0) returns GMT+1 because, according to Wikipedia (and timeanddate.com), "the British Standard Time experiment, with Britain remaining on GMT+1 throughout the year… took place between 27 October 1968 and 31 October 1971"

AlanQ
  • 91
  • 1
  • 12