C# Class System.Date

Represents the ECMA Date object.
Show file Open project: vannatech/blade Class Usage Examples

Public Methods

Method Description
Date ( )

Initializes a new instance of the Date class.

Date ( int year, int month, int date, int hours, int minutes, int seconds, int milliseconds )

Initializes a new instance of the Date class.

Date ( long milliseconds )

Initializes a new instance of the Date class.

Date ( string dateString )

Initializes a new instance of the Date class.

UTC ( ) : int

Gets the number of milliseconds in a date string sine Jan 1, 1970, in universal time.

getDate ( ) : int

Get the day of the month.

getDay ( ) : int

Gets the day of the week.

getFullYear ( ) : int

Gets the full year.

getHours ( ) : int

Gets the hour.

getMilliseconds ( ) : int

Gets the milliseconds.

getMinutes ( ) : int

Gets the minutes.

getMonth ( ) : int

Gets the month.

getSeconds ( ) : int

Gets the seconds.

getTime ( ) : int

Get the number of milliseconds since Jan 1, 1970.

getTimezoneOffset ( ) : int

Gets the time difference between GMT and local time, in minutes.

getUTCDate ( ) : int

Gets the day of the month, in universal time.

getUTCDay ( ) : int

Gets the day of the week, in universal time.

getUTCFullYear ( ) : int

Gets the year, in universal time.

getUTCHours ( ) : int

Gets the hour, in universal time.

getUTCMilliseconds ( ) : int

Gets the milliseconds, in universal time.

getUTCMinutes ( ) : int

Gets the minutes, in universal time.

getUTCMonth ( ) : int

Gets the month, in universal time.

getUTCSeconds ( ) : int

Gets the seconds, in universal time.

now ( ) : int

Gets the current date and time as an offset in milliseconds since Jan 1, 1970.

parse ( string dateString ) : int

A string representing a date.

setDate ( int date ) : void

Sets the day of the month, from 1-31.

setFullYear ( int year ) : void

Sets the four digit year.

setHours ( int hour ) : void

Sets the hour, from 0-23.

setMilliseconds ( int milliseconds ) : void

Sets the milliseconds, from 0-999.

setMinutes ( int minute ) : void

Set the minutes, from 0-59.

setMonth ( int month ) : void

Sets the month, from 0-11.

setSeconds ( int second ) : void

Sets the seconds, from 0-59.

setTime ( int millisecond ) : void

Sets the time as an offset in milliseconds from Jan 1, 1970.

setUTCDate ( int month ) : void

Sets the day of the month, in universal time, from 1-31.

setUTCFullYear ( int year ) : void

Set the four digit year, in universal time.

setUTCHours ( int hour ) : void

Sets the hour, in universal time, from 0-23.

setUTCMilliseconds ( int millisecond ) : void

Sets the milliseconds, in universal time, from 0-999.

setUTCMinutes ( int minute ) : void

Set the minutes, in universal time, from 0-59.

setUTCMonth ( int month ) : void

Sets the month, in universal time, from 0-11.

setUTCSeconds ( int second ) : void

Set the seconds, in universal time, from 0-59.

toDateString ( ) : string

Gets the date portion of a date object as a string.

toLocaleDateString ( ) : string

Gets the date portion of a date object as a string, using locale conventions.

toLocaleTimeString ( ) : string

Gets the time portion of a date object as a string, using locale conventions.

toTimeString ( ) : string

Gets the time portion of a date object as a string.

toUTCString ( ) : string

Gets a date string, in universal time.

Method Details

Date() public method

Initializes a new instance of the Date class.
public Date ( )

Date() public method

Initializes a new instance of the Date class.
public Date ( int year, int month, int date, int hours, int minutes, int seconds, int milliseconds )
year int The year.
month int The month.
date int The date.
hours int The hours.
minutes int The minutes.
seconds int The seconds.
milliseconds int The milliseconds.

Date() public method

Initializes a new instance of the Date class.
public Date ( long milliseconds )
milliseconds long The milliseconds.

Date() public method

Initializes a new instance of the Date class.
public Date ( string dateString )
dateString string The date string.

UTC() public static method

Gets the number of milliseconds in a date string sine Jan 1, 1970, in universal time.
public static UTC ( ) : int
return int

getDate() public method

Get the day of the month.
public getDate ( ) : int
return int

getDay() public method

Gets the day of the week.
public getDay ( ) : int
return int

getFullYear() public method

Gets the full year.
public getFullYear ( ) : int
return int

getHours() public method

Gets the hour.
public getHours ( ) : int
return int

getMilliseconds() public method

Gets the milliseconds.
public getMilliseconds ( ) : int
return int

getMinutes() public method

Gets the minutes.
public getMinutes ( ) : int
return int

getMonth() public method

Gets the month.
public getMonth ( ) : int
return int

getSeconds() public method

Gets the seconds.
public getSeconds ( ) : int
return int

getTime() public method

Get the number of milliseconds since Jan 1, 1970.
public getTime ( ) : int
return int

getTimezoneOffset() public method

Gets the time difference between GMT and local time, in minutes.
public getTimezoneOffset ( ) : int
return int

getUTCDate() public method

Gets the day of the month, in universal time.
public getUTCDate ( ) : int
return int

getUTCDay() public method

Gets the day of the week, in universal time.
public getUTCDay ( ) : int
return int

getUTCFullYear() public method

Gets the year, in universal time.
public getUTCFullYear ( ) : int
return int

getUTCHours() public method

Gets the hour, in universal time.
public getUTCHours ( ) : int
return int

getUTCMilliseconds() public method

Gets the milliseconds, in universal time.
public getUTCMilliseconds ( ) : int
return int

getUTCMinutes() public method

Gets the minutes, in universal time.
public getUTCMinutes ( ) : int
return int

getUTCMonth() public method

Gets the month, in universal time.
public getUTCMonth ( ) : int
return int

getUTCSeconds() public method

Gets the seconds, in universal time.
public getUTCSeconds ( ) : int
return int

now() public static method

Gets the current date and time as an offset in milliseconds since Jan 1, 1970.
public static now ( ) : int
return int

parse() public static method

A string representing a date.
public static parse ( string dateString ) : int
dateString string
return int

setDate() public method

Sets the day of the month, from 1-31.
public setDate ( int date ) : void
date int The date value.
return void

setFullYear() public method

Sets the four digit year.
public setFullYear ( int year ) : void
year int The year value.
return void

setHours() public method

Sets the hour, from 0-23.
public setHours ( int hour ) : void
hour int The hour value.
return void

setMilliseconds() public method

Sets the milliseconds, from 0-999.
public setMilliseconds ( int milliseconds ) : void
milliseconds int The millisecond value.
return void

setMinutes() public method

Set the minutes, from 0-59.
public setMinutes ( int minute ) : void
minute int The minute value.
return void

setMonth() public method

Sets the month, from 0-11.
public setMonth ( int month ) : void
month int The month value.
return void

setSeconds() public method

Sets the seconds, from 0-59.
public setSeconds ( int second ) : void
second int The second value.
return void

setTime() public method

Sets the time as an offset in milliseconds from Jan 1, 1970.
public setTime ( int millisecond ) : void
millisecond int The millisecond value.
return void

setUTCDate() public method

Sets the day of the month, in universal time, from 1-31.
public setUTCDate ( int month ) : void
month int The month value.
return void

setUTCFullYear() public method

Set the four digit year, in universal time.
public setUTCFullYear ( int year ) : void
year int The year value.
return void

setUTCHours() public method

Sets the hour, in universal time, from 0-23.
public setUTCHours ( int hour ) : void
hour int The hour value.
return void

setUTCMilliseconds() public method

Sets the milliseconds, in universal time, from 0-999.
public setUTCMilliseconds ( int millisecond ) : void
millisecond int The millisecond value.
return void

setUTCMinutes() public method

Set the minutes, in universal time, from 0-59.
public setUTCMinutes ( int minute ) : void
minute int The minute value.
return void

setUTCMonth() public method

Sets the month, in universal time, from 0-11.
public setUTCMonth ( int month ) : void
month int The month value.
return void

setUTCSeconds() public method

Set the seconds, in universal time, from 0-59.
public setUTCSeconds ( int second ) : void
second int The second value.
return void

toDateString() public method

Gets the date portion of a date object as a string.
public toDateString ( ) : string
return string

toLocaleDateString() public method

Gets the date portion of a date object as a string, using locale conventions.
public toLocaleDateString ( ) : string
return string

toLocaleTimeString() public method

Gets the time portion of a date object as a string, using locale conventions.
public toLocaleTimeString ( ) : string
return string

toTimeString() public method

Gets the time portion of a date object as a string.
public toTimeString ( ) : string
return string

toUTCString() public method

Gets a date string, in universal time.
public toUTCString ( ) : string
return string