C# Класс NContrib.Extensions.DateTimeExtensions

Показать файл Открыть проект

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

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

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

Метод Описание
ToBeatTime ( this dt ) : double

Converts a timestamp to Swatch Internet Time (beat time)

ToDateTime ( this unixTimestamp ) : System.DateTime

Converts a UNIX timestamp to a DateTime object

ToTimeZone ( this dt, string timeZoneId ) : System.DateTime

Converts a UTC DateTime to a DateTime in the specified timeZoneId

Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\

ToTimeZone ( this dt, string fromTimeZoneId, string toTimeZoneId ) : System.DateTime

Converts a DateTime from one time zone to another

Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\

ToUniversalTime ( this dt, string timeZoneId ) : System.DateTime

Converts an offset DateTime in the specified timeZoneId to a UTC DateTime

Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\

ToUnixTime ( this dt ) : long

Converts the given DateTime to a UNIX timestamp

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

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

Converts a timestamp to Swatch Internet Time (beat time)
public static ToBeatTime ( this dt ) : double
dt this
Результат double

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

Converts a UNIX timestamp to a DateTime object
public static ToDateTime ( this unixTimestamp ) : System.DateTime
unixTimestamp this
Результат System.DateTime

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

Converts a UTC DateTime to a DateTime in the specified timeZoneId
Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\
public static ToTimeZone ( this dt, string timeZoneId ) : System.DateTime
dt this
timeZoneId string Time zone to convert to
Результат System.DateTime

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

Converts a DateTime from one time zone to another
Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\
public static ToTimeZone ( this dt, string fromTimeZoneId, string toTimeZoneId ) : System.DateTime
dt this
fromTimeZoneId string Time zone to convert from
toTimeZoneId string
Результат System.DateTime

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

Converts an offset DateTime in the specified timeZoneId to a UTC DateTime
Use TimeZoneInfo.GetSystemTimeZones() to view available TimeZoneIds Or look in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\
public static ToUniversalTime ( this dt, string timeZoneId ) : System.DateTime
dt this
timeZoneId string Time zone to convert from
Результат System.DateTime

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

Converts the given DateTime to a UNIX timestamp
public static ToUnixTime ( this dt ) : long
dt this
Результат long

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

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

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