Class DateTimeJsonConverter
Newtonsoft: Implements a type converter for DateTime using the culture invariant yyyy-MM-ddTHH:mm:ss.fffZ format.
note
This converter assumes that the DateTime being converted is relative to UTC.
Implements
Namespace: Neon.Data
Assembly: Neon.Common.dll
Syntax
public class DateTimeJsonConverter : JsonConverter<DateTime>, IEnhancedJsonConverter
Properties
Type
Returns the type handled by the converter.
Declaration
public Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
ReadJson(JsonReader, Type, DateTime, bool, JsonSerializer)
Declaration
public override DateTime ReadJson(JsonReader reader, Type objectType, DateTime existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonReader | reader | |
Type | objectType | |
DateTime | existingValue | |
bool | hasExistingValue | |
JsonSerializer | serializer |
Returns
Type | Description |
---|---|
DateTime |
ToSimpleString(object)
Converts an object instance to a simple (non-JSON) string.
Declaration
public string ToSimpleString(object instance)
Parameters
Type | Name | Description |
---|---|---|
object | instance | The object instance. |
Returns
Type | Description |
---|---|
string | The rendered string. |
WriteJson(JsonWriter, DateTime, JsonSerializer)
Declaration
public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonWriter | writer | |
DateTime | value | |
JsonSerializer | serializer |