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

Use timezone aware datetime objects and use local time in webapp #27

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

beenje
Copy link
Collaborator

@beenje beenje commented Feb 15, 2024

  • datetime.utcnow() is deprecated in 3.12 as it returns a naive datetime.
    Use timezone aware datetime objects internally.
    Pydantic serialization adds "Z" to timestamp in UTC timezone. To not brake current mobile clients, we continue returning timestamp without timezone info. We use a custom PlainSerializer. Note that python isoformat() doesn't return "Z" but "+00:00".
  • Format datetime in local timezone in web app
  • Drop support for Python 3.8 (zoneinfo was introduced in 3.9)

datetime.utcnow() is deprecated in 3.12 as it returns a naive datetime.
Use timezone aware datetime objects internally.

Pydantic serialization adds "Z" to timestamp in UTC timezone.
To not brake current mobile clients, we should continue returning
timestamp without timezone info.
We use a custon PlainSerializer.

Note that python isoformat() doesn't return "Z" but "+00:00".
zoneinfo was introduced in 3.9
@emanuelelaface emanuelelaface merged commit 88e8e41 into master Feb 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants