Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone aware datetimes #64

Open
pnuu opened this issue Apr 19, 2024 · 0 comments
Open

Timezone aware datetimes #64

pnuu opened this issue Apr 19, 2024 · 0 comments
Assignees

Comments

@pnuu
Copy link
Member

pnuu commented Apr 19, 2024

With Python 3.12 we get these warnings:

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).

When running the tests, we get 107135 of them (the actual number changes depending on the run time). There are zero warnings with Python 3.11.

We need to make the datetimes timezone aware. I made a quick try, but ran into some snags that I don't have the time to tackle today:

  • the code needs flake8 work
  • we need to stop doing from datetime import datetime as it makes it impossible to do other imports from datetime package. Instead do import datetime as dt
  • making the datetimes tz-aware I got these assertion errors: AssertionError: '2010-12-03T16:28:39' != '2010-12-03T16:28:39+00:00', so I sense we might get backwards incompatibilites within the messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant