Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 6ec0219

Browse files
committed
Convert UTC dates to use LocalTime in Sqlite
1 parent 92817ad commit 6ec0219

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ServiceStack.OrmLite.Sqlite/SqliteOrmLiteDialectProviderBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ public static IOrmLiteDialectProvider Configure(this IOrmLiteDialectProvider pro
285285

286286
public static string ToSqliteDateString(this DateTime dateTime)
287287
{
288-
//Not forcing co-ercsion into UTC for Sqlite
288+
//Convert UTC DateTime to LocalTime for Sqlite
289+
if (dateTime.Kind == DateTimeKind.Utc)
290+
dateTime = dateTime.ToLocalTime();
291+
289292
var dateStr = DateTimeSerializer.ToLocalXsdDateTimeString(dateTime);
290293
dateStr = dateStr.Replace("T", " ");
291294
const int tzPos = 6; //"-00:00".Length;

0 commit comments

Comments
 (0)