C# Class Sharpnote.Json.DateTimeEpochConverter

Custom class for converting date formats with Simplenote
Inheritance: Newtonsoft.Json.Converters.DateTimeConverterBase
Afficher le fichier Open project: Kieranties/Sharpnote

Méthodes publiques

Méthode 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

Méthode Description
CheckType ( Type type ) : void

Method Details

DateToSeconds() public static méthode

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

ReadJson() public méthode

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

SecondsToDate() public static méthode

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

WriteJson() public méthode

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