C# Class Jayrock.UnixTime

Exibir arquivo Open project: atifaziz/Jayrock Class Usage Examples

Public Properties

Property Type Description
EpochUtc System.DateTime

Public Methods

Method Description
ToDateTime ( double time ) : System.DateTime

Converts Unix time (UTC) into a DateTime instance that represents the same time in local time with a maximum precision of a milliseconds.

This method works with time expressed up through 23:59:59, December 31, 3000, UTC.

ToDateTime ( long time ) : System.DateTime

Converts Unix time (UTC) into a DateTime instance that represents the same time in local time with a maximum precision of a second.

This method works with time expressed up through 23:59:59, December 31, 3000, UTC.

ToDateTime ( long time, int ms ) : System.DateTime

Converts a 64-bit Unix time (UTC) into a DateTime instance that represents the same time in local time (precision can be a second or a millisecond depending on whether the second parameter is zero or not).

See Unix time on Wikipedia for more information. This method works with time expressed up through 23:59:59, December 31, 3000, UTC.

ToDouble ( System.DateTime time ) : double

Converts a DateTime instance (assumed to represent local time) to Unix time (UTC) with a precision of over a second (i.e. fractional part of the returned float-point value is fractions of a second).

ToInt64 ( System.DateTime time ) : long

Converts a DateTime instance (assumed to represent local time) to Unix time (UTC) with a maximum precision of a second.

Private Methods

Method Description
UnixTime ( ) : System

Method Details

ToDateTime() public static method

Converts Unix time (UTC) into a DateTime instance that represents the same time in local time with a maximum precision of a milliseconds.
This method works with time expressed up through 23:59:59, December 31, 3000, UTC.
public static ToDateTime ( double time ) : System.DateTime
time double
return System.DateTime

ToDateTime() public static method

Converts Unix time (UTC) into a DateTime instance that represents the same time in local time with a maximum precision of a second.
This method works with time expressed up through 23:59:59, December 31, 3000, UTC.
public static ToDateTime ( long time ) : System.DateTime
time long
return System.DateTime

ToDateTime() public static method

Converts a 64-bit Unix time (UTC) into a DateTime instance that represents the same time in local time (precision can be a second or a millisecond depending on whether the second parameter is zero or not).
See Unix time on Wikipedia for more information. This method works with time expressed up through 23:59:59, December 31, 3000, UTC.
public static ToDateTime ( long time, int ms ) : System.DateTime
time long
ms int
return System.DateTime

ToDouble() public static method

Converts a DateTime instance (assumed to represent local time) to Unix time (UTC) with a precision of over a second (i.e. fractional part of the returned float-point value is fractions of a second).
public static ToDouble ( System.DateTime time ) : double
time System.DateTime
return double

ToInt64() public static method

Converts a DateTime instance (assumed to represent local time) to Unix time (UTC) with a maximum precision of a second.
public static ToInt64 ( System.DateTime time ) : long
time System.DateTime
return long

Property Details

EpochUtc public_oe static_oe property

public static DateTime,System EpochUtc
return System.DateTime