News for hackers. Stuff that matters.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by notatoad on Sunday November 19, 2023 @01:37PM (#38336061)
Removing utcnow() doesn't force you to use tz-aware dates though. That's just a leap that the author of this article has made.

If you're working in a system where all dates are utc, then datetime.now() gets you a date in utc and you don't need datetime.utcnow(). The only reason to call utcnow is if you're working on a system where the local timezone isn't utc, so you inherently have to deal with timezones at some level. Which means that using naive timestamps is a bad idea.

Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by nerdponx on Sunday November 19, 2023 @05:42PM (#38339261)
datetime.now(tz=timezone.utc) is what you probably want most of the time anyway. You can always manually strip off the time zone component if you really want to use datetimes without associated time zones.