C# Class System.DateTimeEpochExtensions

Datei anzeigen Open project: johnnyhalife/wif.swt

Public Methods

Method Description
ToDateTimeFromEpoch ( this secondsSince1970 ) : System.DateTime

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

ToDateTimeOffsetFromEpoch ( this secondsSince1970 ) : DateTimeOffset

Converts the given epoch time to a UTC DateTimeOffset.

ToEpochTime ( this dateTime ) : long

Converts the given date value to epoch time.

Method Details

ToDateTimeFromEpoch() public static method

Converts the given epoch time to a DateTime with DateTimeKind.Utc kind.
public static ToDateTimeFromEpoch ( this secondsSince1970 ) : System.DateTime
secondsSince1970 this
return System.DateTime

ToDateTimeOffsetFromEpoch() public static method

Converts the given epoch time to a UTC DateTimeOffset.
public static ToDateTimeOffsetFromEpoch ( this secondsSince1970 ) : DateTimeOffset
secondsSince1970 this
return DateTimeOffset

ToEpochTime() public static method

Converts the given date value to epoch time.
public static ToEpochTime ( this dateTime ) : long
dateTime this
return long