News for hackers. Stuff that matters.
Re:Pytz: The Fastest Footgun in the West by larkost on Friday May 12, 2023 @12:37PM (#35918567)
The real problem that still is not fixed is that `datetime.date.now()` and others do not do the right thing and encode the system timezone. Rather they record a time without timezone. I have seen this cause so many problems because people are just not aware.
Re:Pytz: The Fastest Footgun in the West by pganssle on Friday May 12, 2023 @03:04PM (#35920719)
Actually, naïve times are considered aware in the system time zone. There's no good way to create a `tzinfo` object that behaves like "the system time zone" and doesn't have unfortunate consequences. See this article: https://blog.ganssle.io/articles/2022/04/naive-local-datetim...

It's not an ideal situation, but given path dependence I don't think it can be improved much from here.

Re:Pytz: The Fastest Footgun in the West by Too on Saturday May 13, 2023 @12:44AM (#35925612)
Even worse is that utcnow() returns timezone unaware dates, when it could have easily returned dates with timezone set to utc. Leading to accidentally mix of local and utc times.