You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, when using `GetDateTimeOffset` on a textual timestamp that did not have an offset (e.g., `2014-04-15 10:47:16`), Microsoft.Data.Sqlite would assume the value was in the local time zone. I.e. the value was parsed as `2014-04-15 10:47:16+02:00` (assuming local time zone was UTC+2).
113
+
114
+
##### New behavior
115
+
116
+
Starting with Microsoft.Data.Sqlite 10.0, when using `GetDateTimeOffset` on a textual timestamp that does not have an offset, Microsoft.Data.Sqlite will assume the value is in UTC.
117
+
118
+
##### Why
119
+
120
+
Is is to align with SQLite's behavior where timestamps without an offset are treated as UTC.
121
+
122
+
##### Mitigations
123
+
124
+
Code should be adjusted accordingly.
125
+
126
+
As a last/temporary resort, you can revert to previous behavior by setting `Microsoft.Data.Sqlite.Pre10TimeZoneHandling` AppContext switch to `true`, see [AppContext for library consumers](/dotnet/api/system.appcontext#ForConsumers) for more details.
Previously, when writing a `DateTimeOffset` value into a REAL column, Microsoft.Data.Sqlite would write the value without taking the offset into account.
141
+
142
+
##### New behavior
143
+
144
+
Starting with Microsoft.Data.Sqlite 10.0, when writing a `DateTimeOffset` value into a REAL column, Microsoft.Data.Sqlite will convert the value to UTC before doing the conversions and writing it.
145
+
146
+
##### Why
147
+
148
+
The value written was incorrect, not aligning with SQLite's behavior where REAL timestamps are asummed to be UTC.
149
+
150
+
##### Mitigations
151
+
152
+
Code should be adjusted accordingly.
153
+
154
+
As a last/temporary resort, you can revert to previous behavior by setting `Microsoft.Data.Sqlite.Pre10TimeZoneHandling` AppContext switch to `true`, see [AppContext for library consumers](/dotnet/api/system.appcontext#ForConsumers) for more details.
Previously, when using `GetDateTime` on a textual timestamp that had an offset (e.g., `2014-04-15 10:47:16+02:00`), Microsoft.Data.Sqlite would return the value with `DateTimeKind.Local` (even if the offset was not local). The time was parsed correctly taking the offset into account.
169
+
170
+
##### New behavior
171
+
172
+
Starting with Microsoft.Data.Sqlite 10.0, when using `GetDateTime` on a textual timestamp that has an offset, Microsoft.Data.Sqlite will convert the value to UTC and return it with `DateTimeKind.Utc`.
173
+
174
+
##### Why
175
+
176
+
Even though the time was parsed correctly it was dependent on the machine-configured local time zone, which could lead to unexpected results.
177
+
178
+
##### Mitigations
179
+
180
+
Code should be adjusted accordingly.
181
+
182
+
As a last/temporary resort, you can revert to previous behavior by setting `Microsoft.Data.Sqlite.Pre10TimeZoneHandling` AppContext switch to `true`, see [AppContext for library consumers](/dotnet/api/system.appcontext#ForConsumers) for more details.
0 commit comments