Re:Handling Time Zone in JavaScript (2019)
by netsharc on Wednesday December 02, 2020 @07:36AM
(#25275789)
Of course there are battle stories, like if a territory announces that from a particular date in the future, they will use a new timezone (with a different offset) - e.g. when the US government changed the start and end of DST during the W. Bush presidency.
So now someone wants to schedule an appointment several months away, at e.g. 4PM in that new timezone. Has the software been updated to know that that 4PM will be in that newly-announced but not yet valid timezone? Otherwise it will store the time with the current UTC offset, which will be the wrong offset the time that appointment arrives.
Re:Handling Time Zone in JavaScript (2019)
by eyelidlessness on Wednesday December 02, 2020 @11:05AM
(#25277637)
That’s the half part of the ass I was talking about. Take my “appointment” example and make it a meet up with an old friend. You may not have any location data to work with. If I live in the pacific TZ and I’m meeting up with an old friend in eastern, December 20th at 11am, “store UTC then adjust in the client” would make me 3 hours late.
I think the correct approach is that "always store times in UTC". Then you adjust for wall-clock time on the client.