Skip to content

Preserve instants when serializing timezone-aware XML datetimes - #172

Draft
Kayvan-Zahiri wants to merge 1 commit into
braintree:masterfrom
Kayvan-Zahiri:codex/normalize-aware-xml-datetimes
Draft

Kayvan-Zahiri wants to merge 1 commit into
braintree:masterfrom
Kayvan-Zahiri:codex/normalize-aware-xml-datetimes

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Summary

The XML generator formats every date/datetime with a Z suffix. For aware datetimes with nonzero offsets, it uses the local wall-clock fields without converting to UTC, changing the represented instant by the offset.

Convert aware datetimes to datetime.timezone.utc before formatting. Preserve existing UTC, naive-datetime, date-only, and second-precision behavior. No API requests or signatures change.

Five public XmlUtil round-trip/control cases cover positive and negative offsets, a UTC date boundary, UTC, naive datetimes, and date-only values. Two regressions fail before the change and three controls pass. Afterward, all 567 unit tests pass. Full package compile and git diff --check pass. Hosted gateway integration tests and the full Python/OS matrix were not run.

Checklist

  • Added changelog entry
  • Existing class method order preserved; no attributes, parameters, or methods added to the changed class
  • Ran unit tests (python3 -m unittest discover tests/unit)
  • Linked internal JIRA ticket: external contributor, none available
  • Reviewed internal JIRA acceptance criteria: external contributor, none available
  • Submitted as a Draft PR for maintainer review

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