diff options
author | crupest <crupest@outlook.com> | 2019-12-11 00:34:24 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-12-11 00:34:24 +0800 |
commit | 24f5c10f5c96b07bc8c1280a1198024c0f00c101 (patch) | |
tree | 8b44c5fb9d1971684c1df417688c1ccdf1f8a415 | |
parent | 7078b0c480ce0b8f44c23cd707826c2fb64b6202 (diff) | |
download | timeline-24f5c10f5c96b07bc8c1280a1198024c0f00c101.tar.gz timeline-24f5c10f5c96b07bc8c1280a1198024c0f00c101.tar.bz2 timeline-24f5c10f5c96b07bc8c1280a1198024c0f00c101.zip |
Fix the format in date string.
Note:
Because standard date time format "s" in Dot Net does not add "Z" at the tail of the result string even if the date is UTC. So I manually add it so that web browser can correctly parse the date string.
-rw-r--r-- | Timeline/Models/Converters/JsonDateTimeConverter.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Timeline/Models/Converters/JsonDateTimeConverter.cs b/Timeline/Models/Converters/JsonDateTimeConverter.cs index 551bbbaa..69af53c1 100644 --- a/Timeline/Models/Converters/JsonDateTimeConverter.cs +++ b/Timeline/Models/Converters/JsonDateTimeConverter.cs @@ -17,7 +17,7 @@ namespace Timeline.Models.Converters public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) { - writer.WriteStringValue(value.ToUniversalTime().ToString("s", CultureInfo.InvariantCulture)); + writer.WriteStringValue(value.ToUniversalTime().ToString("s", CultureInfo.InvariantCulture) + "Z"); } } } |