Reputation: 1329
I'm in a GMT+1 with summer time (GMT+2), using MS Edge with Language set to English (United States). Creating a new Date from the same date but with different years returns different locale date strings.
new Date("1979-09-10T22:00:00.000Z").toLocaleDateString()
// "9/10/1979"
new Date("1980-09-10T22:00:00.000Z").toLocaleDateString()
// "9/11/1980" -> correct day in my case
I'm guessing that the locale used has had a reform regarding timezones in these years. How can I check what the cause of this is?
Upvotes: 0
Views: 218
Reputation: 147343
Using the IANA data at wikipedia to get canonical IANA representative locations that currently have offset +1 and DST of some kind that didn't return the expected strings for "1979-09-10T22:00:00.000Z" and "1980-09-10T22:00:00.000Z" returned a list of:
A quick check on timeanddate.com to find which of the above observe DST of +2 now but didn't 1980 reduces the list to:
All currently have a standard offset of +1 and DST of +2, but didn't observe DST in 1979 or 1980. So likely you're using one of those locations (or another location that links to one of the above as an alias or because it's deprecated).
Some locations represent numerous other locations, e.g. Europe/Zurich is also the canonical location for Europe/Busingen and Europe/Vaduz and is also used for 23 other named places.
DST is likely to continue to change in Europe in particular as the EU wants to stop observing DST entirely. From 2020, member countries had a choice whether to continue to observe it or not. Some will continue to observe it, some will go to their standard offset all year round and some will go to their DST offset all year round. Expect other parts of the world to start messing with offsets more frequently too.
There are also places like Ireland that observe their standard time in summer (+1) and wind their clocks back 1 hour in winter (+0), which is why Europe/Dublin appears to have DST of -1 hour over winter. :-)
Upvotes: 1