CS3 JS: Date

CS3 JavaScript

Date

 A date/time object.

QuickLinks

Date, UTC, getDate, getDay, getFullYear, getHours, getMilliseconds, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getUTCDate, getUTCDay, getUTCFullYear, getUTCHours, getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds, getYear, parse, setDate, setFullYear, setHours, setMilliseconds, setMinutes, setMonth, setSeconds, setTime, setUTCDate, setUTCFullYear, setUTCHours, setUTCMilliseconds, setUTCMinutes, setUTCMonth, setUTCSeconds, setYear, toDateString, toGMTString, toLocaleDateString, toLocaleString, toLocaleTimeString, toSource, toString, toTimeString, toUTCString, valueOf

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.

ParameterTypeDescription
yearnumberThe year expressed in four digits.
monthnumberAn integer value from 0 (Jan) to 11 (Dec). (default: 0)
daynumberAn integer value from 1 to 31, If this argument is not supplied, its value is set to 0. (default: 0)
hoursnumberAn integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0. (default: 0)
minnumberAn integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0)
secnumberAn Integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0)
msnumberAn 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.

ParameterTypeDescription
yearnumberThe year expressed in four digits, for example, 2001.
monthnumberAn integer value from 0 (Jan) to 11 (Dec). (default: 0)
daynumberAn integer value from 1 to 31, If this argument is not supplied, its value is set to 0. (default: 0)
hoursnumberAn integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0. (default: 0)
minnumberAn integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0)
secnumberAn Integer value from 0 to 59. If this argument is not supplied, its value is set to 0. (default: 0)
msnumberAn 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().

ParameterTypeDescription
textstringThe string to parse.

number setDate (date:number)
Sets the day of the month of a specified Date object according to local time.

ParameterTypeDescription
datenumberAn 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.

ParameterTypeDescription
yearnumberA 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.

ParameterTypeDescription
hournumberAn 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.

ParameterTypeDescription
msnumberAn integer value from 0 to 999.

number setMinutes (minutes:number)
Sets the minutes of a specified Date object according to local time.

ParameterTypeDescription
minutesnumberAn integer value from 0 to 59.

number setMonth (month:number)
Sets the month of a specified Date object according to local time.

ParameterTypeDescription
monthnumberAn integer value from 0 (Jan) to 11 (Dec).

number setSeconds (seconds:number)
Sets the seconds of a specified Date object according to local time.

ParameterTypeDescription
secondsnumberAn 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.

ParameterTypeDescription
msnumberAn 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.

ParameterTypeDescription
datenumberAn 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.

ParameterTypeDescription
yearnumberThe year expressed in four digits.

number setUTCHours (hours:number)
Sets the hours of a specified Date object according to UTC.

ParameterTypeDescription
hoursnumberAn 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.

ParameterTypeDescription
msnumberAn 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.

ParameterTypeDescription
minnumberAn 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.

ParameterTypeDescription
monthnumberAn 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.

ParameterTypeDescription
secnumberAn 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.

ParameterTypeDescription
yearnumberAn integer value indicating the year to set.

string toDateString ()

string toGMTString ()

string toLocaleDateString ()

string toLocaleString ()

string toLocaleTimeString ()

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.

string toTimeString ()

string toUTCString ()

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)

Contents :: Index