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

make creation_date timezone-aware #664

Merged

Conversation

amorison
Copy link
Contributor

datetime.now() returns a naive timestamp in the local TZ. When formatting this timestamp, %z and %Z directives would therefore always be empty.

This commit calls .astimezone() to attach the system TZ to this timestamp. %z and %Z directives when formatting the timestamp are now respected.

`datetime.now()` returns a naive timestamp in the local TZ. When
formatting this timestamp, `%z` and `%Z` directives would therefore
always be empty.

This commit calls `.astimezone()` to attach the system TZ to this
timestamp. `%z` and `%Z` directives when formatting the timestamp are
now respected.
Copy link
Member

@ZedThree ZedThree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks @amorison !

@ZedThree ZedThree merged commit 96f3e23 into Fortran-FOSS-Programmers:master Oct 1, 2024
6 checks passed
@amorison amorison deleted the am/tz-aware-timestamp branch October 1, 2024 18:12
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