datetime.utcnow
and datetime.utcfromtimestamp
will be deprecated in #python 3.12: https://github.com/python/cpython/issues/103857
If you maintain a package, now is probably a good time to grep your source code for utcnow
and utcfromtimestamp
to get out ahead of the deprecation warnings. 📅🕐
@tewalds That would break backwards compatibility in a much more subtle way, and create a situation where its difficult to tell whether or not you are in compliance. You wouldn’t be able to just grep for uses of utcnow
, and we would have no way of warning you that at some point your code will break.
There’s also no easy way to “opt-in” to the new behavior like there is with just not using utcnow
and utcfromtimestamp
.
It is better to remove these entirely.