コード例 #1
0
#pragma warning disable IDE0060
        public static DateTime DeserializeStatic(ref JsonReader reader, JsonSerializerOptions options)
        {
            reader.SkipWhiteSpace();
            var str = reader.ReadNotNullStringSegmentRaw();

            if (IntegerConverter.TryRead(str, out ulong ticks))
            {
                return(unixEpoch.AddSeconds(ticks));
            }

            throw new JsonParsingException("Invalid Unix timestamp.");
        }