C# Class Ikayzo.SDL.SDLDateTime

An SDL compliant DateTime class. This class wraps a DateTime instance and allows a timezone to be specified. SDL uses the Gregorian calendar and a 24 hour clock (0-23)
ファイルを表示 Open project: ikayzo/SDL.NET Class Usage Examples

Public Methods

Method Description
Equals ( object obj ) : bool

Tests for equality using ToString()

GetHashCode ( ) : int

Generates a hashcode using ToString().GetHashCode()

SDLDateTime ( System.DateTime dateTime, string timeZone ) : System

Create an instance representing an SDL date or SDL DateTime type.

SDLDateTime ( int year, int month, int day ) : System

Create a date instance

SDLDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond ) : System

Create a date time instance

SDLDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, string timeZone ) : System

Create a date time instance with the specified timezone

ToString ( ) : string

Create a string in the standard SDL format. For dates the format is yyyy/MM/dd for date/time instances the format is yyyy/MM/dd HH:mm:ss.fff-z

Private Methods

Method Description
getCurrentTimeZone ( ) : string

Method Details

Equals() public method

Tests for equality using ToString()
public Equals ( object obj ) : bool
obj object The object to test
return bool

GetHashCode() public method

Generates a hashcode using ToString().GetHashCode()
public GetHashCode ( ) : int
return int

SDLDateTime() public method

Create an instance representing an SDL date or SDL DateTime type.
If the time zone is not /// a valid time zone ID (ex. America/Los_Angeles), three letter /// abbreviation (ex. HST), or GMT(+/-)hh(:mm) formatted custom /// timezone (ex. GMT+02 or GMT+02:30)
public SDLDateTime ( System.DateTime dateTime, string timeZone ) : System
dateTime System.DateTime The date (and possibly time)
timeZone string The timezone specified as a timezone ID /// (ex America/Los_Angeles), GMT(+/-)hh(:mm), or three letter code /// (such as PST or JST). For three letter timezones that are /// ambiguous behavior is unspecified. In these cases, the full /// timezone ID or GMT(+/-)hh(:mm) format should be used. ///
return System

SDLDateTime() public method

Create a date instance
public SDLDateTime ( int year, int month, int day ) : System
year int The year
month int The month (1-12)
day int The day of the month
return System

SDLDateTime() public method

Create a date time instance
public SDLDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond ) : System
year int The year
month int The month (1-12)
day int The day of the month (1-31)
hour int The hour of the day (0-23)
minute int 0-59
second int 0-59
millisecond int 0-999
return System

SDLDateTime() public method

Create a date time instance with the specified timezone
public SDLDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, string timeZone ) : System
year int The year
month int The month (1-12)
day int The day of the month (1-31)
hour int The hour of the day (0-23)
minute int 0-59
second int 0-59
millisecond int 0-999
timeZone string The timezone for this date/time
return System

ToString() public method

Create a string in the standard SDL format. For dates the format is yyyy/MM/dd for date/time instances the format is yyyy/MM/dd HH:mm:ss.fff-z
public ToString ( ) : string
return string