Date object

The Date objects allow you to perform advanced time and date manipulations. The Date object can be created using the following syntax:

var CurrentTime = new Date();
var DateObject = new Date(2003, 12, 31, 13, 30, 25); // December 31, 2003, 13:30:25


Constructors

Date Creates a new date object and assigns it current date and time.
Date Creates a new date object and assigns it specified date and time.

Methods

GetYear Returns a year stored in this Date object
GetMonth Returns a month stored in this Date object
GetDate Returns a day of the month stored in this Date object
GetHours Returns hours stored in this Date object
GetMinutes Returns minutes stored in this Date object
GetSeconds Returns seconds stored in this Date object
GetWeekday Returns a weekday of the date stored in this Date object
SetYear Sets a year of this Date object
SetMonth Sets a month of this Date object
SetDate Sets a day of the month of this Date object
SetHours Sets hours of this Date object
SetMinutes Sets minutes of this Date object
SetSeconds Sets seconds of this Date object
SetCurrentTime Sets this Date object to the current system date and time

Attributes

Type (read only) Returns always "date"

Date()

Creates a new date object and assigns it current date and time.


Date(Year, Month, Day, Hours, Minutes, Seconds)

Creates a new date object and assigns it specified date and time.


GetYear()

Returns a year stored in this Date object


GetMonth()

Returns a month stored in this Date object


GetDate()

Returns a day of the month stored in this Date object


GetHours()

Returns hours stored in this Date object


GetMinutes()

Returns minutes stored in this Date object


GetSeconds()

Returns seconds stored in this Date object


GetWeekday()

Returns a weekday of the date stored in this Date object


SetYear(Year)

Sets a year of this Date object


SetMonth(Month)

Sets a month of this Date object


SetDate(Day)

Sets a day of the month of this Date object


SetHours(Hours)

Sets hours of this Date object


SetMinutes(Minutes)

Sets minutes of this Date object


SetSeconds(Seconds)

Sets seconds of this Date object


SetCurrentTime()

Sets this Date object to the current system date and time