News for hackers. Stuff that matters.
Re:Temporal: Getting started with JavaScript's new date time... by tomp on Monday June 28, 2021 @02:53PM (#27666082)
The original mistake you did was let someone else handle the timezone conversion. You should probably always default to storing UTC-normalized timezoneless datetimes (there's of course a number of exceptions, but generally "an instant" in the past should be translated into UTC before being stored into the database... with future dates/times, it's more ambiguous, but in any case, you should be doing the TZ conversion yourself).
Re:Temporal: Getting started with JavaScript's new date time... by mabbo on Monday June 28, 2021 @03:11PM (#27666365)
Yes, this exactly. Use timezones when displaying something to a user and otherwise not at all, imho.
Re:Temporal: Getting started with JavaScript's new date time... by nicoburns on Monday June 28, 2021 @06:26PM (#27669073)
This falls down if the timezones themselves change. e.g. if DST was planned, but was then cancelled. You really want to store the original time with timezone as well as UTC.