News for hackers. Stuff that matters.
Re:Temporal: Getting started with JavaScript's new date time... by mulmen on Monday June 28, 2021 @03:48PM (#27666913)
But would using local time help in this case? For example, what if the future event is something like the solstice?

It's usecase dependent so it seems like the application should deal with this, at which point persisting in UTC is still a reasonable choice.

Re:Temporal: Getting started with JavaScript's new date time... by DasIch on Monday June 28, 2021 @05:28PM (#27668401)
When you schedule an event in the future like “meet me at 14:00 in cafe foo”, this means local time and it’s going to mean 14:00 local time even when the timezone changes.

If you store this in UTC and the timezone changes, you end up converting to the wrong time.

So for future events you should store local time with a location you can map to a timezone.

Re:Temporal: Getting started with JavaScript's new date time... by mulmen on Monday June 28, 2021 @07:52PM (#27669851)
The solstice is based on astronomical phenomena. If you store it in UTC it will always be right.
Re:Temporal: Getting started with JavaScript's new date time... by funcDropShadow on Tuesday June 29, 2021 @08:38AM (#27674963)
Unless there is a leap second scheduled on short notice or you install the updated tz database rather late. For astronomical events or long term measurements (think CERN) there is astronomical time, which does not add leap seconds.

But if you want to have precise date time far in the future you must not use UTC based milliseconds representations unless you want to check for necessary database migrations every time the time zone definitions change.

Re:Temporal: Getting started with JavaScript's new date time... by mulmen on Tuesday June 29, 2021 @05:09PM (#27681767)
If you store zoned time in UTC then the zones or UTC change then the time can be formatted correctly in the future.

My point in mentioning the solstice is that while some events are at “2pm”, others are “when something happens”.

Sure, UTC is not suitable for conducting astronomy. It is suitable for working with human friendly times, since it is the foundation of timezones.