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 (retry) #13

Merged
merged 9 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.

@motus motus merged commit 0bb50f6 into motus:sergiym/datetime/utc Mar 18, 2024
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