News for hackers. Stuff that matters.
Re:Ten Python datetime pitfalls, and what libraries are (not... by coldtea on Sunday February 18, 2024 @03:36PM (#39422969)
>So IMO this is more of an UnspecifiedZoneTime than a LocalDateTime. (Also, it has no date portion.

It very well could also have a date portion.

E.g. "I want this alarm/cleanup/whatever to happen on 9am on the 1st Monday of each month" based on the timezone the user happens to be at that time - i.e. not tied to any specific timezone.

Re:Ten Python datetime pitfalls, and what libraries are (not... by amluto on Sunday February 18, 2024 @04:24PM (#39423526)
That’s still a different thing: it’s a recurring event, which is an almost entirely separate can of worms from a datetime.

And a recurrence library probably wants to avoid libc-style “localtime” here — plumbing the concept of users in places to it seems awkward. A genuinely naive time may be better — the interface could be “calculate the next recurrence of this recurring event in this timezone,” not “here’s a recurring event with associated ‘local’ time — calculate the next occurrence given my /etc/localtime and TZ environment variable”.