Skip to content

Commit 8bf5d94

Browse files
authored
Merge pull request #87 from Millarex/patch-1
Convert DateTime values to Utc kind
2 parents 973aa2b + e722ee9 commit 8bf5d94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Serilog.Ui.PostgreSqlProvider/PostgreDataProvider.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public PostgresDataProvider(RelationalDbOptions options)
2727
DateTime? endDate = null
2828
)
2929
{
30+
if (startDate != null && startDate.Value.Kind != DateTimeKind.Utc)
31+
startDate = DateTime.SpecifyKind(startDate.Value, DateTimeKind.Utc);
32+
if (endDate != null && endDate.Value.Kind != DateTimeKind.Utc)
33+
endDate = DateTime.SpecifyKind(endDate.Value, DateTimeKind.Utc);
3034
var logsTask = GetLogsAsync(page - 1, count, logLevel, searchCriteria, startDate, endDate);
3135
var logCountTask = CountLogsAsync(logLevel, searchCriteria, startDate, endDate);
3236

@@ -139,4 +143,4 @@ private void GenerateWhereClause(
139143
}
140144
}
141145
}
142-
}
146+
}

0 commit comments

Comments
 (0)