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

Update DATETIME_FORMAT to clarify it must be UTC #1163

Merged
merged 3 commits into from
Feb 28, 2023
Merged

Update DATETIME_FORMAT to clarify it must be UTC #1163

merged 3 commits into from
Feb 28, 2023

Conversation

ikonst
Copy link
Contributor

@ikonst ikonst commented Feb 19, 2023

The DATETIME_FORMAT is

  1. used as a format string for strftime but only for UTC datetimes
  2. interpolated into error messages

While the %z didn't matter for (1) as it was always "+0000", for (2) it suggested that UTCDateTimeAttribute can read serialized values with different timezone offsets, which is not the case.

Fixes #1139.

@anandswaminathan
Copy link
Contributor

@ikonst Just want to make sure - While the %z didn't matter for (1) as it was always "+0000", is true.

This would be a dangerous serialization change if not

@ikonst
Copy link
Contributor Author

ikonst commented Feb 24, 2023

@anandswaminathan the serialization code is value.astimezone(timezone.utc).strftime(DATETIME_FORMAT) so I think %z would always become "+0000"

@ikonst ikonst merged commit b5600ea into master Feb 28, 2023
@ikonst ikonst deleted the issue-1139 branch February 28, 2023 00:21
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.

Incostistent log and documentation.
2 participants