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

pinnwand: use aware datetime objects #289

Merged
merged 1 commit into from
Nov 15, 2024
Merged

pinnwand: use aware datetime objects #289

merged 1 commit into from
Nov 15, 2024

Conversation

supakeen
Copy link
Owner

@supakeen supakeen commented Nov 15, 2024

Deprecation warnings are being emitted about using datetime.utcnow and to replace those with datetime.now(timezone.utc). This creates a timezone aware datetime object hence we now need to get datetime aware objects from the database as well.

This seems to a bit annoying in (for example SQLite) for the backend.

We use a 3rd-party package to provide us with an UtcDateTime type for SQLAlchemy to fix this.

@supakeen supakeen force-pushed the timezone-aware branch 3 times, most recently from 9f4fe52 to e2af682 Compare November 15, 2024 11:43
Deprecation warnings are being emitted about using `datetime.utcnow` and
to replace those with `datetime.now(timezone.utc)`. This creates a
timezone aware datetime object hence we now need to get datetime aware
objects from the database as well.

This seems to a bit annoying in (for example SQLite) for the backend.

We use a 3rd-party package to provide us with an `UtcDateTime` type for
SQLAlchemy to fix this.

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen supakeen merged commit cc8daad into master Nov 15, 2024
22 checks passed
@supakeen supakeen deleted the timezone-aware branch November 15, 2024 13:17
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.

1 participant