Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider the local tz when creating a datetime object from timestamp
Otherwise datetime.fromtimestamp will return a naive datetime in the local timezone and applying timezone modifications later with TIMEZONE and TO_TIMEZONE won't do the right thing. Parsing a unix timestamp value should always result in the exact same instant in time regardless of current time zone, so it shouldn't matter what the current TIMEZONE setting is, whether 'UTC', 'local', any other timezone, or even unset.
- Loading branch information
Showing
2 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters