Skip to content

Commit 9930eaf

Browse files
committed
Fix date values not getting parsed to UTC
1 parent 94e2d64 commit 9930eaf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Foundatio.Parsers.SqlQueries/Extensions/SqlNodeExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using System.Text;
56
using Foundatio.Parsers.LuceneQueries.Extensions;
@@ -369,7 +370,7 @@ private static void AppendField(StringBuilder builder, EntityFieldInfo field, st
369370
}
370371
else
371372
{
372-
builder.Append("DateTime.Parse(\"" + term + "\")");
373+
builder.Append("DateTime.Parse(\"" + term + "\", null, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal)");
373374
}
374375
}
375376
else if (field is { IsDateOnly: true })

0 commit comments

Comments
 (0)