JsonDateTimeMcsConverter

Ecng.Serialization

Provides a JSON converter for converting DateTime values from Unix timestamps in microseconds.

Наследует: JsonDateTimeConverter

Конструкторы

JsonDateTimeMcsConverter
public JsonDateTimeMcsConverter()
jsonDateTimeMcsConverter = JsonDateTimeMcsConverter()

Initializes a new instance of the JsonDateTimeMcsConverter class using microseconds.

Методы

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.

Возвращает: 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.