sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/DatasyncIsoDateTimeConverter.cs
/// <summary>
/// Reads the JSON representation of the object.
/// </summary>
/// <param name="reader">The <see cref="JsonReader"/> to read from.</param>
/// <param name="objectType">Type of the object.</param>
/// <param name="existingValue">The existing value of object being read.</param>
/// <param name="serializer">The calling serializer.</param>
/// <returns>The object value.</returns>
Reads the JSON representation of the object.
Reads the JSON representation of the object .
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            object datetimeObject = base.ReadJson(reader, objectType, existingValue, serializer);
            if (datetimeObject != null)
            {
                if (datetimeObject is DateTime dt)
                {
                    return dt.ToLocalTime();
                }
                else if (datetimeObject is DateTimeOffset dto)
                {
                    return dto.ToLocalTime();
                }
            }
            return datetimeObject;
        }
public override object ReadJson ( JsonReader reader , Type objectType , object existingValue , JsonSerializer serializer ) { object datetimeObject = base . ReadJson ( reader , objectType , existingValue , serializer ) ; if ( datetimeObject != null ) { if ( datetimeObject is DateTime dt ) { return dt . ToLocalTime ( ) ; } else if ( datetimeObject is DateTimeOffset dto ) { return dto . ToLocalTime ( ) ; } } return datetimeObject ; }
Reads the JSON representation of the object.
Reads the JSON representation of the object .
The object value.
The object value .
reader
JsonReader
The  to read from.
The to read from .
objectType
Type
Type of the object.
Type of the object .
existingValue
object
The existing value of object being read.
The existing value of object being read .
serializer
JsonSerializer
The calling serializer.
The calling serializer .