Date
QuickLinks
Methods
Date Date (year:number [, month:number=0] [, day:number=0] [, hours:number=0] [, min:number=0] [, sec:number=0] [, ms:number=0])
Returns a new Date object holding the current date and time.
Parameter | Type | Description |
---|---|---|
year | number | The year expressed in four digits. |
month | number | An integer value from 0 (Jan) to 11 (Dec). (default: 0) |
day | number | An integer value from 1 to 31, If this argument is not supplied, its value is set to 0. (default: 0) |
hours | number | An integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0. (default: 0) |
min | number | An integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0) |
sec | number | An Integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0) |
ms | number | An integer value from 0 to 999. If this argument is not supplied, its value is set to 0. (default: 0) |
Date UTC (year:number [, month:number=0] [, day:number=0] [, hours:number=0] [, min:number=0] [, sec:number=0] [, ms:number=0])
Returns the number of milliseconds between midnight January 1, 1970, UTC, and the specified time.
Parameter | Type | Description |
---|---|---|
year | number | The year expressed in four digits, for example, 2001. |
month | number | An integer value from 0 (Jan) to 11 (Dec). (default: 0) |
day | number | An integer value from 1 to 31, If this argument is not supplied, its value is set to 0. (default: 0) |
hours | number | An integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0. (default: 0) |
min | number | An integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0) |
sec | number | An Integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0) |
ms | number | An integer value from 0 to 999. If this argument is not supplied, its value is set to 0. (default: 0) |
number getDate ()
Returns the day of the month of the specified Date object in local time.
number getDay ()
Returns the day of the week for the specified Date object in local time.
number getFullYear ()
Returns the four digit year of the specified Date object in local time.
number getHours ()
Returns the hour of the specified Date object in local time.
number getMilliseconds ()
Returns the milliseconds of the specified Date object in local time.
number getMinutes ()
Returns the minutes of the specified Date object in local time.
number getMonth ()
Returns the month of the specified Date object in local time.
number getSeconds ()
Returns the seconds of the specified Date object in local time.
number getTime ()
Returns the number of milliseconds since midnight January 1,1970 UTC for the specified Date object.
number getTimezoneOffset ()
Returns the difference in minutes between the computer's local time and UTC.
number getUTCDate ()
Returns the day of the month of the specified Date object according to UTC.
number getUTCDay ()
Returns the day of the week for the specified Date object according to UTC.
number getUTCFullYear ()
Returns the four digit year of the specified Date object according to UTC.
number getUTCHours ()
Returns the hour of the specified Date object according to UTC.
number getUTCMilliseconds ()
Returns the milliseconds of the specified Date object according to UTC.
number getUTCMinutes ()
Returns the minutes of the specified Date object according to UTC.
number getUTCMonth ()
Returns the month of the specified Date object according to UTC.
number getUTCSeconds ()
Returns the seconds of the specified Date object according to UTC.
number getYear ()
Returns the year of the specified Date object, as a difference from 1900, in local time.
Date parse (text:string)
Parses a string, returning a new Date object. The string should be similar to the string returned bt toString().
Parameter | Type | Description |
---|---|---|
text | string | The string to parse. |
number setDate (date:number)
Sets the day of the month of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
date | number | An integer from 1 to 31 indicating the day of the month. |
number setFullYear (year:number)
Sets the year of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
year | number | A four-digit integer value indicating the year to set. |
number setHours (hour:number)
Sets the hours of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
hour | number | An integer value from 0 (midnight) to 23 (11 PM). |
number setMilliseconds (ms:number)
Sets the milliseconds of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
ms | number | An integer value from 0 to 999. |
number setMinutes (minutes:number)
Sets the minutes of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
minutes | number | An integer value from 0 to 59. |
number setMonth (month:number)
Sets the month of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
month | number | An integer value from 0 (Jan) to 11 (Dec). |
number setSeconds (seconds:number)
Sets the seconds of a specified Date object according to local time.
Parameter | Type | Description |
---|---|---|
seconds | number | An integer value from 0 to 59. |
number setTime (ms:number)
Sets the date of a specified Date object in milliseconds since midnight, January 1, 1970.
Parameter | Type | Description |
---|---|---|
ms | number | An integer indicating the number of milliseconds between the date set and midnight, January 1, 1970. |
number setUTCDate (date:number)
Sets the date of a specified Date object according to universal time.
Parameter | Type | Description |
---|---|---|
date | number | An integer from 1 to 31 indicating the day of the month. |
number setUTCFullYear (year:number)
Sets the year of a specified Date object according to UTC, can also set the month and date.
Parameter | Type | Description |
---|---|---|
year | number | The year expressed in four digits. |
number setUTCHours (hours:number)
Sets the hours of a specified Date object according to UTC.
Parameter | Type | Description |
---|---|---|
hours | number | An integer value from 0 (midnight) to 23 (11 PM) indicating the hour to be set. |
number setUTCMilliseconds (ms:number)
Sets the milliseconds of a specified Date object according to UTC.
Parameter | Type | Description |
---|---|---|
ms | number | An integer value in the range of 0 to 999 indicating the number of milliseconds to set. |
number setUTCMinutes (min:number)
Sets the minutes of a specified Date object according to UTC.
Parameter | Type | Description |
---|---|---|
min | number | An integer value in the range 0 to 59 indicating the number of minutes to be set. |
number setUTCMonth (month:number)
Sets the month of a specified Date object according to UTC.
Parameter | Type | Description |
---|---|---|
month | number | An integer value in the range 0 (Jan.) to 11 (Dec.) indicating the month to set. |
number setUTCSeconds (sec:number)
Sets the seconds of a specified Date object according to UTC.
Parameter | Type | Description |
---|---|---|
sec | number | An integer value in the range 0 to 59 indicating the number of seconds to set. |
number setYear (year:number)
Sets the year of a specified Date object according to local time, as a difference between the current year and 1900.
Parameter | Type | Description |
---|---|---|
year | number | An integer value indicating the year to set. |
string toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with built-in classes.
string toString ()
Returns a string value representing the date and time stored in the Date object in human readable format.
number valueOf ()
The valueOf() method returns the number of milliseconds that have passed since midnight, Returns an integer.
Element of
$.buildDate
File.created
File.modified
Folder.created
Folder.modified
Return
Date Date.Date (year:number [, month:number=0] [, day:number=0] [, hours:number=0] [, min:number=0] [, sec:number=0] [, ms:number=0])
Date Date.UTC (year:number [, month:number=0] [, day:number=0] [, hours:number=0] [, min:number=0] [, sec:number=0] [, ms:number=0])
Date Date.parse (text:string)