Class UnixDateTimeConverter
Converts a DateTime object to and from JSON. DateTime is represented as the total number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).
public sealed class UnixDateTimeConverter : DateTimeConverterBase
- Inheritance
-
UnixDateTimeConverter
- Extension Methods
Constructors
UnixDateTimeConverter()
public UnixDateTimeConverter()
Methods
ReadJson(JsonReader, Type, object, JsonSerializer)
Reads the JSON representation of the DateTime object.
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Parameters
reader
JsonReaderThe Newtonsoft.Json.JsonReader to read from.
objectType
TypeType of the object.
existingValue
objectThe existing value of object being read.
serializer
JsonSerializerThe calling serializer.
Returns
- object
The DateTime object value.
WriteJson(JsonWriter, object, JsonSerializer)
Writes the JSON representation of the DateTime object.
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
writer
JsonWriterThe Newtonsoft.Json.JsonWriter to write to.
value
objectThe value.
serializer
JsonSerializerThe calling serializer.