1

Found out about this weird behaviour today while debugging my app.

new Date("1896-01-01T00:00:00+0800")
Wed Jan 01 1896 00:00:00 GMT+0800 (Australian Western Standard Time)
new Date("1895-01-01T00:00:00+0800")
Mon Dec 31 1894 23:43:24 GMT+0743 (Australian Western Standard Time)

Basically all dates before 1986 have this weird timezone GMT+0743 as Australian Western Standard Time whereas it should be GMT+0800. This causes all dates before then to get converted to one day before.

Tested with Chrome and Firefox and the behaviour is the same.

Anybody know why this happens?

Riccardo
  • 504
  • 4
  • 4
  • It's deliberate. Time zones as we now know them have not existed for very long, so some smarty people decided that projecting them backwards is inaccurate. – Pointy Feb 18 '19 at 04:22
  • The behavior (in JavaScript at least) changed fairly recently, like over the past couple years. I think Chrome was first. – Pointy Feb 18 '19 at 04:22
  • In early ECMAScript, current timezone rules were applied as if they'd always existed. Now, timezone rules are supposed to reflect historic changes. Prior to 1900, most places had a local offset down to a few minutes. Places continue to change their offset today (other than daylight saving offsets). There are other good answers besides the duplicate. – RobG Feb 18 '19 at 05:10
  • According to the [*time and date*](https://www.timeanddate.com/time/zone/australia/perth) web site, the offset for Perth, WA was UTC +7:43:24 from 1800 to 1894, then at 00:00 on 1 Dec 1895 the offset was changed to +8 and has not changed since (except for dabbling in daylight saving a few times between 1970 and 2010). – RobG Feb 18 '19 at 05:31
  • @RobG you are correct, it seems to be due to the change in timezone difference happened in 1895. So I guess that is the right behaviour... It doesn't seem related to the question you marked mine as duplicate with. Can you please remove that? – Riccardo Feb 18 '19 at 07:48
  • @RiccardoTrebbi—while your issue is not related to Chrome, it's fundamentally the same issue: unusual timezone offsets caused by historic timezones. – RobG Feb 18 '19 at 08:56
  • [Here is the specific LMT entry causing this particular offset](https://github.com/eggert/tz/blob/2018i/australasia#L45-L47). As other have stated, this is normal. – Matt Johnson-Pint Feb 18 '19 at 19:52

0 Answers0