C# Class Facebook.DateTimeConvertor

Utilities to convert dates to and from unix time.
Mostrar archivo Open project: liquidboy/X Class Usage Examples

Public Methods

Method Description
FromIso8601FormattedDateTime ( string iso8601DateTime ) : System.DateTime

Converts ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ) date time to DateTime.

FromUnixTime ( double unixTime ) : System.DateTime

Converts a unix time string to a DateTime object.

FromUnixTime ( string unixTime ) : System.DateTime

Converts a unix time string to a DateTime object.

ToIso8601FormattedDateTime ( System.DateTime dateTime ) : string

Converts to specified DateTime to ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ).

ToUnixTime ( System.DateTime dateTime ) : double

Converts a DateTime object to unix time.

ToUnixTime ( DateTimeOffset dateTime ) : double

Converts a DateTimeOffset object to unix time.

Method Details

FromIso8601FormattedDateTime() public static method

Converts ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ) date time to DateTime.
public static FromIso8601FormattedDateTime ( string iso8601DateTime ) : System.DateTime
iso8601DateTime string /// The ISO-8601 formatted date time. ///
return System.DateTime

FromUnixTime() public static method

Converts a unix time string to a DateTime object.
public static FromUnixTime ( double unixTime ) : System.DateTime
unixTime double The unix time.
return System.DateTime

FromUnixTime() public static method

Converts a unix time string to a DateTime object.
public static FromUnixTime ( string unixTime ) : System.DateTime
unixTime string The string representation of the unix time.
return System.DateTime

ToIso8601FormattedDateTime() public static method

Converts to specified DateTime to ISO-8601 format (yyyy-MM-ddTHH:mm:ssZ).
public static ToIso8601FormattedDateTime ( System.DateTime dateTime ) : string
dateTime System.DateTime /// The date time. ///
return string

ToUnixTime() public static method

Converts a DateTime object to unix time.
public static ToUnixTime ( System.DateTime dateTime ) : double
dateTime System.DateTime The date time.
return double

ToUnixTime() public static method

Converts a DateTimeOffset object to unix time.
public static ToUnixTime ( DateTimeOffset dateTime ) : double
dateTime DateTimeOffset The date time.
return double