C# Class TraktPlugin.TraktAPI.Extensions.DateTimeExtensions

ファイルを表示 Open project: trakt/Trakt-for-Mediaportal

Public Methods

Method Description
FromEpoch ( this unixTime ) : System.DateTime

Long extension method to convert a Unix epoch time to a standard C# DateTime object.

FromISO8601 ( this dt ) : System.DateTime
OlsenToWindowsTimezone ( this olsenTimezone ) : string

Returns the corresponding Olsen timezone e.g. 'Atlantic/Canary' into a Windows timezone e.g. 'GMT Standard Time'

ToEpoch ( this dt ) : long

Date Time extension method to return a unix epoch time as a long

ToISO8601 ( this dt, double hourShift ) : string
ToISO8601 ( this dt, double hourShift, bool isLocal = false ) : string

Converts string DateTime to ISO8601 format 2014-09-01T09:10:11.000Z

ToLocalisedDayOfWeek ( this date ) : string

Method Details

FromEpoch() public static method

Long extension method to convert a Unix epoch time to a standard C# DateTime object.
public static FromEpoch ( this unixTime ) : System.DateTime
unixTime this
return System.DateTime

FromISO8601() public static method

public static FromISO8601 ( this dt ) : System.DateTime
dt this
return System.DateTime

OlsenToWindowsTimezone() public static method

Returns the corresponding Olsen timezone e.g. 'Atlantic/Canary' into a Windows timezone e.g. 'GMT Standard Time'
public static OlsenToWindowsTimezone ( this olsenTimezone ) : string
olsenTimezone this
return string

ToEpoch() public static method

Date Time extension method to return a unix epoch time as a long
public static ToEpoch ( this dt ) : long
dt this
return long

ToISO8601() public static method

public static ToISO8601 ( this dt, double hourShift ) : string
dt this
hourShift double
return string

ToISO8601() public static method

Converts string DateTime to ISO8601 format 2014-09-01T09:10:11.000Z
public static ToISO8601 ( this dt, double hourShift, bool isLocal = false ) : string
dt this DateTime as string
hourShift double Number of hours to shift original time
isLocal bool
return string

ToLocalisedDayOfWeek() public static method

public static ToLocalisedDayOfWeek ( this date ) : string
date this
return string