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
readerJsonReaderThe Newtonsoft.Json.JsonReader to read from.
objectTypeTypeType of the object.
existingValueobjectThe existing value of object being read.
serializerJsonSerializerThe 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
writerJsonWriterThe Newtonsoft.Json.JsonWriter to write to.
valueobjectThe value.
serializerJsonSerializerThe calling serializer.