JsonDateTimeNanoConverter
Ecng.Serialization
Provides a JSON converter for converting DateTime values from Unix timestamps in nanoseconds.
构造函数
JsonDateTimeNanoConverter
public JsonDateTimeNanoConverter()
jsonDateTimeNanoConverter = JsonDateTimeNanoConverter()
Initializes a new instance of the JsonDateTimeNanoConverter class using nanoseconds.
方法
Convert
protected override DateTime Convert(double value)
result = jsonDateTimeNanoConverter.Convert(value)
Converts the specified double value to a DateTime using nanosecond precision.
- value
- The double value representing the Unix timestamp in nanoseconds.
返回值: A DateTime corresponding to the Unix timestamp.
WriteJson
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
jsonDateTimeNanoConverter.WriteJson(writer, value, serializer)
Writes the JSON representation of the object in nanoseconds.