-
Notifications
You must be signed in to change notification settings - Fork 360
fix(timezone): Make datetime usage timezone-aware for DTZ lint rules #8355
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
adcc887
fix(timezone): Make datetime usage timezone-aware for DTZ lint rules
jenshnielsen c5c9f6d
fix(timezone): Include UTC offset in dataset timestamp strings
jenshnielsen 8ca3517
docs: Extend newsfragments to cover all timezone changes on this branch
jenshnielsen 39a5b1d
fix(timezone): Keep log file and screenshot names in local time
jenshnielsen e6ff912
Potential fix for pull request finding
jenshnielsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| The default format of ``DataSetProtocol.run_timestamp``, | ||
| ``DataSetProtocol.completed_timestamp`` and | ||
| ``qcodes.dataset.sqlite.queries.raw_time_to_str_time`` changed from | ||
| ``"%Y-%m-%d %H:%M:%S"`` to ``"%Y-%m-%d %H:%M:%S%z"``, i.e. the rendered | ||
| timestamps now include the UTC offset of the local timezone, e.g. | ||
| ``"2026-07-31 10:27:25+0200"``. | ||
|
|
||
| Timestamps are stored in the QCoDeS database as POSIX timestamps, which do not | ||
| capture the timezone in which the measurement was performed. They are therefore | ||
| still rendered in the local timezone of the machine reading the dataset, but | ||
| the resulting string is no longer ambiguous. This also applies to the | ||
| ``run_timestamp`` and ``completed_timestamp`` attributes written when exporting | ||
| a dataset to NetCDF or xarray. | ||
|
|
||
| Pass an explicit ``fmt`` argument to restore the previous behaviour. | ||
|
|
||
| Parameter cache timestamps are now timezone aware. ``ParameterBase.cache.timestamp`` | ||
| (and therefore ``Parameter.get_latest.get_timestamp()``) returns a | ||
| ``datetime`` with ``tzinfo`` set to the local timezone rather than a naive | ||
| ``datetime``. Code that compares these timestamps to naive ``datetime`` objects | ||
| will raise ``TypeError`` and must be updated to use timezone aware datetimes. | ||
|
|
||
| Consequently the ``"ts"`` field of a parameter snapshot changed from | ||
| ``"%Y-%m-%d %H:%M:%S"`` to ISO 8601 format including the UTC offset, e.g. | ||
| ``"2026-07-31 10:27:25+02:00"``. Snapshots can be parsed with | ||
| ``datetime.datetime.fromisoformat``. |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fixed the timezone offset written into the waveform and sequence files | ||
| generated by the Tektronix AWG70000A drivers. The offset was computed manually | ||
| from ``time.timezone``, which gave the offset the wrong sign and ignored | ||
| daylight saving time, so e.g. a machine in UTC+02:00 wrote ``-02:00``. The | ||
| offset is now taken from the local timezone of the timestamp itself. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.