Json Deserialization of ISO8601 UTC dates with fraction of second

I have found that the deserialization of iso8601 UTC dates is not done right when fractions of seconds with less than 3 digits of precision are coming.

    static void Main(string[] args)
    {
        using (JsConfig.CreateScope("AssumeUtc:false,AlwaysUseUtc:true,SkipDateTimeConversion:true"))
        {
            var dt3Dec = JsonSerializer.DeserializeFromString<DateTime>("2020-08-07T09:36:20.960Z");
            var dt2Dec = JsonSerializer.DeserializeFromString<DateTime>("2020-08-07T09:36:20.96Z");
            var dt1Dec = JsonSerializer.DeserializeFromString<DateTime>("2020-08-07T09:36:20.9Z");
            var dtNoDec = JsonSerializer.DeserializeFromString<DateTime>("2020-08-07T09:36:20Z");
            Console.WriteLine(TimeZoneInfo.Local.ToString());
            Console.WriteLine("3 dec: " + dt3Dec.ToString());
            Console.WriteLine("2 dec: " + dt2Dec.ToString());
            Console.WriteLine("1 dec: " + dt1Dec.ToString());
            Console.WriteLine("0 dec: " + dtNoDec.ToString());
        }
    }

Result:

    (UTC+01:00) Brussels, Copenhagen, Madrid, Paris
    3 dec: 07/08/2020 09:36:20
    2 dec: 07/08/2020 11:36:20
    1 dec: 07/08/2020 11:36:20
    0 dec: 07/08/2020 09:36:20

Until de fix arives (if is really a bug), How can i overwrite the DeSerializeFn only inside a Scope and not to affect the deserializations outside the scope?

This should now be resolved from this commit.
This change is available from v5.9.3 that’s now available on MyGet.

The Custom Type Serializer handlers are static, they can’t be scoped. You’ll need to update to use the latest version to access the fix.

Now it works on my test.

When is scheduled to be released on stable/nuget repo? (5.9.4 or 5.10)

Next version will likely be major v5.10 which wont be for a while, you’ll need to upgrade to v5.9.3 on MyGet in the meantime.