You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/moin/storage/middleware/indexing.py:177: DeprecationWarning:
datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in
a future version.
Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
doc[key] = datetime.datetime.utcfromtimestamp(doc[key])
Notable:
it recommends using datetime.fromtimestamp instead of .utcfromtimestamp .
This is a 100% compatible replacement (we used that in borgbackup to avoid the deprecation warning):
def utcfromtimestamp(timestamp):
"""Returns a naive datetime instance representing the timestamp in the UTC timezone"""
return datetime.fromtimestamp(timestamp, timezone.utc).replace(tzinfo=None)
Notable:
https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp
The text was updated successfully, but these errors were encountered: