C# Класс InTheHand.DateTimeOffsetHelper

Helper class for DateTimeOffset.
PlatformVersion supported AndroidAndroid 4.4 and later iOSiOS 9.0 and later macOSOS X 10.7 and later Windows UWPWindows 10 Windows StoreWindows 8.1 or later Windows Phone StoreWindows Phone 8.1 or later Windows Phone SilverlightWindows Phone 8.0 or later Windows (Desktop Apps)Windows Vista or later
Показать файл Открыть проект

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

Метод Описание
FromNSDate ( NSDate date ) : DateTimeOffset
FromUnixTimeMilliseconds ( long milliseconds ) : DateTimeOffset

Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.

FromUnixTimeSeconds ( long seconds ) : DateTimeOffset

Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.

ToNSDate ( this value ) : NSDate
ToUnixTimeMilliseconds ( this date ) : long

Returns the number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z.

Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). It does not take leap seconds into account. This method returns the number of milliseconds in Unix time.

This method first converts the current instance to UTC before returning the number of milliseconds in its Unix time. For date and time values before 1970-01-01T00:00:00Z, this method returns a negative value.

ToUnixTimeSeconds ( this date ) : long

Returns the number of seconds that have elapsed since 1970-01-01T00:00:00Z.

Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). It does not take leap seconds into account.

This method first converts the current instance to UTC before returning its Unix time. For date and time values before 1970-01-01T00:00:00Z, this method returns a negative value.

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

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

public static FromNSDate ( NSDate date ) : DateTimeOffset
date NSDate
Результат DateTimeOffset

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

Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.
public static FromUnixTimeMilliseconds ( long milliseconds ) : DateTimeOffset
milliseconds long A Unix time, expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). /// For Unix times before this date, its value is negative.
Результат DateTimeOffset

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

Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.
public static FromUnixTimeSeconds ( long seconds ) : DateTimeOffset
seconds long A Unix time, expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). /// For Unix times before this date, its value is negative.
Результат DateTimeOffset

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

public static ToNSDate ( this value ) : NSDate
value this
Результат NSDate

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

Returns the number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z.
Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). It does not take leap seconds into account. This method returns the number of milliseconds in Unix time.

This method first converts the current instance to UTC before returning the number of milliseconds in its Unix time. For date and time values before 1970-01-01T00:00:00Z, this method returns a negative value.

public static ToUnixTimeMilliseconds ( this date ) : long
date this The DateTimeOffset value.
Результат long

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

Returns the number of seconds that have elapsed since 1970-01-01T00:00:00Z.
Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). It does not take leap seconds into account.

This method first converts the current instance to UTC before returning its Unix time. For date and time values before 1970-01-01T00:00:00Z, this method returns a negative value.

public static ToUnixTimeSeconds ( this date ) : long
date this The DateTimeOffset value.
Результат long