News for hackers. Stuff that matters.
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.
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?
Re:JavaScript dates are about to be fixed by jitl on Saturday August 24, 2024 @02:59PM (#41340546)
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.
Re:JavaScript dates are about to be fixed by labster on Saturday August 24, 2024 @02:25PM (#41340261)
The main problem is that future values of TAI converted into most time zones is nondeterministic. On the other hand, at least you can guarantee all TAI seconds will actually occur.