JsonDateTimeMcsConverter
Ecng.Serialization
Provides a JSON converter for converting DateTime values from Unix timestamps in microseconds.
Inherits: JsonDateTimeConverter
Constructors
JsonDateTimeMcsConverter
public JsonDateTimeMcsConverter()
jsonDateTimeMcsConverter = JsonDateTimeMcsConverter()
Initializes a new instance of the JsonDateTimeMcsConverter class using microseconds.
Methods
Convert
protected override DateTime Convert(double value)
result = jsonDateTimeMcsConverter.Convert(value)
Converts the specified double value to a DateTime using microsecond precision.
- value
- The double value representing the Unix timestamp in microseconds.
Returns: A DateTime corresponding to the Unix timestamp.
WriteJson
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
jsonDateTimeMcsConverter.WriteJson(writer, value, serializer)
Writes the JSON representation of the object in microseconds.