sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/DatasyncIsoDateTimeConverter.cs
/// <summary>
/// Writes the JSON representation of the object.
/// </summary>
/// <param name="writer">The <see cref="JsonWriter"/> to write to.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The calling serializer.</param>
Writes the JSON representation of the object.
Writes the JSON representation of the object .
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            DateTime dateTime;
            if (value is DateTime time)
            {
                dateTime = time.ToUniversalTime();
            }
            else
            {
                dateTime = ((DateTimeOffset)value).UtcDateTime;
            }
            base.WriteJson(writer, dateTime, serializer);
        }
public override void WriteJson ( JsonWriter writer , object value , JsonSerializer serializer ) { DateTime dateTime ; if ( value is DateTime time ) { dateTime = time . ToUniversalTime ( ) ; } else { dateTime = ( ( DateTimeOffset ) value ) . UtcDateTime ; } base . WriteJson ( writer , dateTime , serializer ) ; }
Writes the JSON representation of the object.
Writes the JSON representation of the object .
writer
JsonWriter
The  to write to.
The to write to .
value
object
None
serializer
JsonSerializer
The calling serializer.
The calling serializer .