Skip to content

Commit 43fac93

Browse files
author
Brian Cummings
committed
Added invariantculture to time converter
1 parent d4317a0 commit 43fac93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PathfinderHonorManager/Converters/NullableDateTimeConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using System;
22
using System.Text.Json;
33
using System.Text.Json.Serialization;
4+
using System.Globalization;
45

56
namespace PathfinderHonorManager.Converters
67
{
78
public class NullableDateTimeConverter : JsonConverter<DateTime?>
89
{
910
public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1011
{
11-
return reader.GetString() == null ? (DateTime?)null : DateTime.Parse(reader.GetString());
12+
return reader.GetString() == null ? (DateTime?)null : DateTime.Parse(reader.GetString(), CultureInfo.InvariantCulture);
1213
}
1314

1415
public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options)

0 commit comments

Comments
 (0)