Re:JavaScript dates are about to be fixed
by RandomThoughts3 on Saturday August 24, 2024 @01:54PM
(#41339985)
Technically you could use TAI for most things internally and use an offset when you display. It works perfectly for records. The only issue is with scheduled things when your users probably want to point at something in their timezone.
[ Parent
| on HN ]
Re:JavaScript dates are about to be fixed
by ikekkdcjkfke on Saturday August 24, 2024 @02:37PM
(#41340364)
Or toLocalDisplayString(TAI timestamp). It seems like timezones and their rules change over time and geographic location, using todays rules to show dates back in time with previous rules would be broken right?
Well, any correct time handling library will use something like the IANA timezone database (aka tz/tzdb/zoneinfo) which stores all the changes in timezone rules for localities over the years - a library that only knows "today's rules" would be fundamentally broken as you say. So the internals of toLocalDisplayString(timestamp, timezone, calendar, locale) should look up the appropriate rules in effect at the timestamp and use those to decide the local time to display.