Skip to content

FIX: store aware datetimes as UTC in UTCDateTime columns - #3090

Merged
Richard Lundeen (richlundeen) merged 1 commit into
microsoft:mainfrom
u7k4rs6:fix/utc-datetime-bind
Oct 11, 2026
Merged

Richard Lundeen (richlundeen) merged 1 commit into
microsoft:mainfrom
u7k4rs6:fix/utc-datetime-bind

Conversation

@u7k4rs6

Copy link
Copy Markdown
Contributor

Fixes #3089.

Adds UTCDateTime.process_bind_param: aware values get converted to naive UTC before they're stored or compared. Naive values are still taken as UTC and pass through as before, and nothing changes in the schema.

Filter bounds were already normalized by the callers, and they now go through the same conversion, so they stay consistent.

Tests: bind conversion (offset, naive, None), plus a SQLite round trip where a -07:00 message timestamp and seed date_added come back as the same instant. The round trip fails on main. tests/unit/memory and models: 3285 passed (test_memory_migrations_head_command fails locally on main too, missing build_scripts).

@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 11, 2026
Merged via the queue into microsoft:main with commit c2c4e12 Oct 11, 2026
55 checks passed
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.

BUG: UTCDateTime stores aware non-UTC datetimes without converting them

2 participants