logoalt Hacker News

skrtskrt • today at 5:38 PM • 1 reply • view on HN

But there is zero use case difference between these two things you mentioned:

> if a point in time should be sticky to a calendar store a datetime _without_ a timezone

> If you want a point in time which will not "physically" change, store a datetime _with_ a timezone

Both of these things are exactly identical. You are still storing an exact point in time in both cases. The only thing about a calendar use case is the presentation layer.


Replies

pseidemann • today at 6:01 PM

> You are still storing an exact point in time in both cases.

No this is not correct. You store two different intents. Suppose you want a reminder in your calendar every day at 15:00 for the next 7 days. It should not change if DST changes in the middle of the seven days. It should not change if legislation of my timezone changes. How do you encode this? A UTC timestamp for each of the seven days will change the hour if the DST changes or the timezone changes. So what you can do is store a datetime _without_ a timezone, exactly reflecting what the user entered when creating the calendar entry, which is "2026-09-29 15:00:00", "2026-09-30 15:00:00", etc. This is the intent wanted by the user, which is a "sticky" time in their calendar. These are not exact points in time, since timezones can and will change (DST), so the "physical" instant of 15:00 can be a different "actual" (as in, the sun has a different position, earth rotation is different) time when comparing the days. Instead, these are exact times in 7 days only in a (specific) calendar.

➕ show 1 reply