Commit 9e4e745
fix: MsSQL timezone-safe timestamp normalization via AT TIME ZONE (#51)
* fix: MsSQL timezone-safe timestamp normalization via AT TIME ZONE
Wrap MsSQL normalize_timestamp() with explicit UTC conversion using
CAST(value AS DATETIMEOFFSET) AT TIME ZONE 'UTC'. MsSQL cannot set
a session timezone, so we normalize explicitly in the SQL to ensure
consistent cross-database timestamp comparisons.
Closes #30
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: only apply UTC conversion for TimestampTZ columns in MsSQL
CAST(datetime AS DATETIMEOFFSET) assigns +00:00 unconditionally, not
the server's local timezone. UTC conversion only helps for datetimeoffset
columns (TimestampTZ). For timezone-naive datetime/datetime2 columns,
the conversion is a no-op — values are used as-is since the source
timezone is unknown.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 18af77a commit 9e4e745
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| |||
0 commit comments