C# Class SGDE.Content.Code.Library.Date

The Date class represents date and time information.
Inheritance: Object
显示文件 Open project: sgdc/sgdc-old

Public Methods

Method Description
Date ( ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month, Number date ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month, Number date, Number hour ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute, Number second ) : System

Constructs a new Date object that holds the specified date and time.

Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute, Number second, Number millisecond ) : System

Constructs a new Date object that holds the specified date and time.

UTC ( Number year, Number month ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

UTC ( Number year, Number month, Number date ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

UTC ( Number year, Number month, Number date, Number hour ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

UTC ( Number year, Number month, Number date, Number hour, Number minute ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

UTC ( Number year, Number month, Number date, Number hour, Number minute, Number second ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

UTC ( Number year, Number month, Number date, Number hour, Number minute, Number second, Number millisecond ) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

getFullYear ( ) : Number

Returns the full year (a four-digit number, such as 2000) of a Date object according to local time.

getTime ( ) : Number

Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object.

getUTCFullYear ( ) : Number

Returns the four-digit year of a Date object according to universal time (UTC).

parse ( String date ) : Number

Converts a string representing a date into a number equaling the number of milliseconds elapsed since January 1, 1970, UTC.

toDateString ( ) : String

Returns a string representation of the day and date only, and does not include the time or timezone.

toLocaleDateString ( ) : String

Returns a String representation of the day and date only, and does not include the time or timezone.

toLocaleString ( ) : String

Returns a String representation of the day, date, time, given in local time.

toLocaletimeString ( ) : String

Returns a String representation of the time only, and does not include the day, date, year, or timezone.

toString ( ) : String

Returns a String representation of the day, date, time, and timezone.

toTimeString ( ) : String

Returns a String representation of the time and timezone only, and does not include the day and date.

toUTCString ( ) : String

Returns a String representation of the day, date, and time in universal time (UTC).

Private Methods

Method Description
parseDate ( string str ) : System.DateTime
toString ( string format, bool local, bool utc ) : String

Method Details

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( ) : System
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month, Number date ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month, Number date, Number hour ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute, Number second ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
second Number An integer from 0 to 59.
return System

Date() public method

Constructs a new Date object that holds the specified date and time.
public Date ( Object yearOrTimevalue, Number month, Number date, Number hour, Number minute, Number second, Number millisecond ) : System
yearOrTimevalue Object /// If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise /// all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a /// negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after. ///
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
second Number An integer from 0 to 59.
millisecond Number An integer from 0 to 999 of milliseconds.
return System

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
return Number

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month, Number date ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
return Number

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month, Number date, Number hour ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
return Number

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month, Number date, Number hour, Number minute ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
return Number

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month, Number date, Number hour, Number minute, Number second ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
second Number An integer from 0 to 59.
return Number

UTC() public static method

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.
public static UTC ( Number year, Number month, Number date, Number hour, Number minute, Number second, Number millisecond ) : Number
year Number A four-digit integer that represents the year (for example, 2000).
month Number An integer from 0 (January) to 11 (December).
date Number An integer from 1 to 31.
hour Number An integer from 0 (midnight) to 23 (11 p.m.).
minute Number An integer from 0 to 59.
second Number An integer from 0 to 59.
millisecond Number An integer from 0 to 999.
return Number

getFullYear() public method

Returns the full year (a four-digit number, such as 2000) of a Date object according to local time.
public getFullYear ( ) : Number
return Number

getTime() public method

Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object.
public getTime ( ) : Number
return Number

getUTCFullYear() public method

Returns the four-digit year of a Date object according to universal time (UTC).
public getUTCFullYear ( ) : Number
return Number

parse() public static method

Converts a string representing a date into a number equaling the number of milliseconds elapsed since January 1, 1970, UTC.
public static parse ( String date ) : Number
date String A string representation of a date, which conforms to the format for the output of Date.toString().
return Number

toDateString() public method

Returns a string representation of the day and date only, and does not include the time or timezone.
public toDateString ( ) : String
return String

toLocaleDateString() public method

Returns a String representation of the day and date only, and does not include the time or timezone.
public toLocaleDateString ( ) : String
return String

toLocaleString() public method

Returns a String representation of the day, date, time, given in local time.
public toLocaleString ( ) : String
return String

toLocaletimeString() public method

Returns a String representation of the time only, and does not include the day, date, year, or timezone.
public toLocaletimeString ( ) : String
return String

toString() public method

Returns a String representation of the day, date, time, and timezone.
public toString ( ) : String
return String

toTimeString() public method

Returns a String representation of the time and timezone only, and does not include the day and date.
public toTimeString ( ) : String
return String

toUTCString() public method

Returns a String representation of the day, date, and time in universal time (UTC).
public toUTCString ( ) : String
return String