Skip to content

Commit c41bc79

Browse files
committed
Remove chromium workaround for datetime
1 parent 79916bc commit c41bc79

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

dotnet/src/webdriver/BiDi/Communication/Json/Converters/DateTimeOffsetConverter.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,7 @@ internal class DateTimeOffsetConverter : JsonConverter<DateTimeOffset>
2727
{
2828
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2929
{
30-
// Workaround: it should be Int64, chrome uses double for `expiry` like "expiry":1737379944.308351
31-
32-
if (reader.TryGetInt64(out long unixTime) is false)
33-
{
34-
var doubleValue = reader.GetDouble();
35-
36-
unixTime = Convert.ToInt64(doubleValue);
37-
}
38-
39-
return DateTimeOffset.FromUnixTimeMilliseconds(unixTime);
30+
return DateTimeOffset.FromUnixTimeMilliseconds(reader.GetInt64());
4031
}
4132

4233
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)

0 commit comments

Comments
 (0)