C# Class Sharpnote.Json.DateTimeEpochConverter

Custom class for converting date formats with Simplenote
Inheritance: Newtonsoft.Json.Converters.DateTimeConverterBase
ファイルを表示 Open project: Kieranties/Sharpnote

Public Methods

Method Description
DateToSeconds ( DateTimeOffset dto ) : string

Returns the number of seconds since 01/01/1970

ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
SecondsToDate ( double seconds ) : DateTimeOffset

Gets a date from the given number of seconds

WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void

Private Methods

Method Description
CheckType ( Type type ) : void

Method Details

DateToSeconds() public static method

Returns the number of seconds since 01/01/1970
public static DateToSeconds ( DateTimeOffset dto ) : string
dto DateTimeOffset The date to be parsed
return string

ReadJson() public method

public ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
reader Newtonsoft.Json.JsonReader
objectType System.Type
existingValue object
serializer Newtonsoft.Json.JsonSerializer
return object

SecondsToDate() public static method

Gets a date from the given number of seconds
public static SecondsToDate ( double seconds ) : DateTimeOffset
seconds double
return DateTimeOffset

WriteJson() public method

public WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void
writer Newtonsoft.Json.JsonWriter
value object
serializer Newtonsoft.Json.JsonSerializer
return void