Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
sunghwan2789 committed Sep 19, 2024
1 parent b8887bf commit 22785f4
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,11 @@ private static bool TryDeserializeFromString(
string? serialized,
[NotNullWhen(true)] out DateTimeOffset? value)
{
if (serialized is not null
&& serialized.EndsWith("Z")
&& DateTime.TryParse(
serialized,
CultureInfo.InvariantCulture,
DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal,
out var zuluTime))
{
value = new DateTimeOffset(
zuluTime.ToUniversalTime(),
TimeSpan.Zero);
return true;
}

if (serialized is not null
&& DateTimeOffset.TryParse(
serialized,
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out var dt))
{
value = dt;
Expand Down

0 comments on commit 22785f4

Please sign in to comment.