C# Класс Jayrock.UnixTime

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EpochUtc System.DateTime

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
UnixTime ( ) : System

Описание методов

ToDateTime() публичный статический Метод

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
Результат System.DateTime

ToDateTime() публичный статический Метод

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
Результат System.DateTime

ToDateTime() публичный статический Метод

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
Результат System.DateTime

ToDouble() публичный статический Метод

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
Результат double

ToInt64() публичный статический Метод

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
Результат long

Описание свойств

EpochUtc публичное статическое свойство

public static DateTime,System EpochUtc
Результат System.DateTime