Class JsonDate
public static class JsonDate- Inheritance
- 
      
      JsonDate
- Inherited Members
Properties
Now
public static double Now { get; }Property Value
Methods
GetTime(DateTime)
public static double GetTime(DateTime tDate)Parameters
- tDateDateTime
- Either a local time or an UTC time. 
Returns
- double
- Number of milliseconds since 1970-01-01 UTC. If the given date was - DateTime.MinValue, then zero will be returned.
Parse(string)
Converts a JSON string representation of a date to a DateTime value.
public static DateTime Parse(string sDate)Parameters
- sDatestring
- String date to convert. If this is - nullor empty, then- DateTime.MinValuewill be returned.
Returns
Remarks
Valid formats include "yyyy-MM-ddTHH:mm:ss.fffffffK" and its subsets.
Parse(string, DateTimeKind)
Converts a JSON string representation of a date to a DateTime value.
public static DateTime Parse(string sDate, DateTimeKind nDateTimeKindDefault)Parameters
- sDatestring
- String date to convert. If this is - nullor empty, then- DateTime.MinValuewill be returned.
- nDateTimeKindDefaultDateTimeKind
- Default DateTimeKind which is used, if parsed DateTime.Kind equals DateTimeKind.Unspecified. A value of DateTimeKind.Unspecified is here useless. 
Returns
Remarks
Valid formats include "yyyy-MM-ddTHH:mm:ss.fffffffK" and its subsets.
SetTime(double)
Converts milliseconds since 1970-01-01 UTC to a DateTime in local time.
public static DateTime SetTime(double nMilliseconds)Parameters
- nMillisecondsdouble
- Milliseonds to convert. If this is zero, then - DateTime.MinValuewill be returned.
Returns
SetTimeUtc(double)
Converts milliseconds since 1970-01-01 UTC to a DateTime UTC value.
public static DateTime SetTimeUtc(double nMilliseconds)Parameters
- nMillisecondsdouble
Returns
- DateTime
- A - DateTimewith- DateTimeKind.Utcthat represents the JSON time given in milliseconds. If zero was given, then- DateTime.MinValuewill be returned.
ToDateString(DateTime)
Converts a DateTime value to a JSON string representation of a date.
public static string ToDateString(DateTime tDate)Parameters
- tDateDateTime
- The date value to convert. 
Returns
- string
- If the parameter is - DateTime.MinValue, then- nullwill be returned. Otherwise a date string according to the pattern "yyyy-MM-dd" will be returned.
ToDateTimeString(DateTime)
public static string ToDateTimeString(DateTime tDate)Parameters
- tDateDateTime
Returns
ToISOString(DateTime)
Converts a DateTime value to a JSON string representation of a date.
public static string ToISOString(DateTime tDate)Parameters
- tDateDateTime
- The date value to convert. 
Returns
- string
- If the parameter is - DateTime.MinValue, then- nullwill be returned. Otherwise the date is converted to UTC and an ISO-8601 compliant UTC date string according to the pattern "yyyy-MM-ddTHH:mm:ss.fffffffK" will be returned.