C# 클래스 HermaFx.DateTimeEpochExtensions

Provides conversion of DateTime and DateTimeOffset into an epoch-relative number value (total seconds). See Unix Epoch in Wikipedia for more information on why this might be needed. Typical uses include using this simplified representation as an expiration time for a token, password or verification code.
파일 보기 프로젝트 열기: evicertia/HermaFx

공개 메소드들

메소드 설명
ToDateTime ( this secondsSince1970 ) : System.DateTime

Converts the given epoch time to a DateTime with DateTimeKind.Utc kind.

ToDateTimeOffset ( this secondsSince1970 ) : DateTimeOffset

Converts the given epoch time to a UTC DateTimeOffset.

ToUnixTime ( this dateTime ) : long

Converts the given date value to epoch/unix time.

메소드 상세

ToDateTime() 공개 정적인 메소드

Converts the given epoch time to a DateTime with DateTimeKind.Utc kind.
public static ToDateTime ( this secondsSince1970 ) : System.DateTime
secondsSince1970 this The seconds to convert
리턴 System.DateTime

ToDateTimeOffset() 공개 정적인 메소드

Converts the given epoch time to a UTC DateTimeOffset.
public static ToDateTimeOffset ( this secondsSince1970 ) : DateTimeOffset
secondsSince1970 this The seconds to convert
리턴 DateTimeOffset

ToUnixTime() 공개 정적인 메소드

Converts the given date value to epoch/unix time.
public static ToUnixTime ( this dateTime ) : long
dateTime this The data to convert
리턴 long