A decision should be made whether to keep naive datetime objects or switch to timezone-aware datetimes.
Using timezone-aware objects like datetime.now(timezone.utc) ensures future compatibility and avoids the upcoming deprecation of datetime.utcnow().
For now, this PR performs a drop-in replacement with datetime.now(timezone.utc).replace(tzinfo=None) to retain compatibility with the existing naive datetime usage,
without altering the current behavior or implementation. Future revisions should consider full timezone awareness for better clarity and accuracy in time handling.
>>> from datetime import datetime, timezone
>>> print(datetime.now(timezone.utc))
2024-10-01 12:25:56.239591+00:00
>>> print(datetime.utcnow())
<stdin>:1: 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).
2024-10-01 12:26:08.612555
>>> print(datetime.now(timezone.utc).replace(tzinfo=None))
2024-10-01 12:27:28.583477
Once approved, we can proceed with updating the remaining packages.
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
:heart: Thank you for your contribution!
Description
Note:
A decision should be made whether to keep naive datetime objects or switch to timezone-aware datetimes. Using timezone-aware objects like
datetime.now(timezone.utc)
ensures future compatibility and avoids the upcoming deprecation ofdatetime.utcnow()
. For now, this PR performs a drop-in replacement withdatetime.now(timezone.utc).replace(tzinfo=None)
to retain compatibility with the existing naive datetime usage, without altering the current behavior or implementation. Future revisions should consider full timezone awareness for better clarity and accuracy in time handling.Once approved, we can proceed with updating the remaining packages.
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: