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

Enforce storage/retrieval conversion to UTC #12

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

bpkroth
Copy link

@bpkroth bpkroth commented Mar 18, 2024

Further improvements on microsoft#716.

Sqlite does not store timezone info even if provided, so retrieving the data may be interpretted according to the host machine's local timezone, which may or may not be UTC.

To mitigate this, this change ensures that all timestamps are

  1. first converted to UTC before storing into the DB,
  2. converted (or augmented with zoneinfo) to UTC on retrieval

Additionally, we expand the tests to check for this behavior, first with some additional conversion matrixes when telemetry or status data is received in implicit local vs. explicit timezone data as well as executions where the implicit local timezone has be overridden with a TZ environment variable, to simulate different default timezone hosts.

@bpkroth bpkroth merged commit 94b44af into motus:sergiym/datetime/utc Mar 18, 2024
@bpkroth bpkroth deleted the sergiym/datetime/utc branch March 18, 2024 18:21
@bpkroth
Copy link
Author

bpkroth commented Mar 18, 2024

Oops. Accidentally pushed this to your branch. Rolled it back for review first and redid in #13

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