DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)
Design
Since datetule.UTC does not exists in previous versions,
Changeset
Replaced utcnow() with dt.datetime.now(timezone.utc).replace(tzinfo=None)
Fix warning for python 3.12 on utcnow()
Goal
Remove the following deprecation warning:
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)
Design
Since datetule.UTC does not exists in previous versions,
Changeset
Replaced utcnow() with
dt.datetime.now(timezone.utc).replace(tzinfo=None)
Testing