Developer Resources
Date
Overview
A class that represents a date and time.
Base Class
Constructor
- Date()
- Date(milliseconds : Number)
- Date(text : String)
- Date(year : Number, month : Number, day : Number, hour : Number, minute : Number, second : Number, millisecond : Number)
Arguments
- milliseconds
- The number of milliseconds between 1/1/1970 00:00:00 and the date represented by the new Date.
- text
- A string that specifies the new Date
- year
- The year of the new Date.
- month
- The month of the new Date.
- day
- The day of the new Date. Optional.
- hour
- The hour of the new Date. Optional.
- minute
- The minute of the new Date. Optional.
- second
- The second of the new Date. Optional.
- millisecond
- The millisecond of the new Date. Optional.
Methods
- Date.UTC
- Returns the number of milliseconds between 1/1/1970 00:00:00 and the argument.
- Date.getDate
- Returns the day of the month.
- Date.getDay
- Returns the day of the week.
- Date.getFullYear
- Returns the year.
- Date.getHours
- Returns the hours.
- Date.getMilliseconds
- Returns the milliseconds.
- Date.getMinutes
- Returns the minutes.
- Date.getMonth
- Returns the month.
- Date.getSeconds
- Returns the seconds.
- Date.getTime
- Returns the milliseconds since 1/1/1970 00:00:00.
- Date.getTimezoneOffset
- Returns the number of minutes difference between local and UTC time.
- Date.getUTCDate
- Returns the day of month in universal time.
- Date.getUTCDay
- Returns the day of the week in universal time.
- Date.getUTCFullYear
- Returns the year in universal time.
- Date.getUTCHours
- Returns the hours in universal time.
- Date.getUTCMilliseconds
- Returns the milliseconds in universal time.
- Date.getUTCMinutes
- Returns the minutes in universal time.
- Date.getUTCMonth
- Returns the month in universal time.
- Date.getUTCSeconds
- Returns the seconds in universal time.
- Date.getYear
- Returns the year.
- Date.parse
- Parses the argument and returns the number of milliseconds between 1/1/1970 00:00:00.
- Date.setDate
- Sets the day of the month.
- Date.setFullYear
- Sets the year.
- Date.setHours
- Sets the hour.
- Date.setMilliseconds
- Sets the milliseconds.
- Date.setMinutes
- Sets the minutes.
- Date.setMonth
- Sets the month.
- Date.setSeconds
- Sets the seconds.
- Date.setTime
- Sets the date using milliseconds since 1/1/1970 00:00:00.
- Date.setUTCDate
- Sets the day of the month in universal time.
- Date.setUTCFullYear
- Sets the year in universal time.
- Date.setUTCHours
- Sets the hour in universal time.
- Date.setUTCMilliseconds
- Sets the milliseconds in universal time.
- Date.setUTCMinutes
- Sets the minutes in universal time.
- Date.setUTCMonth
- Sets the month in universal time.
- Date.setUTCSeconds
- Sets the seconds in universal time.
- Date.setYear
- Sets the year.
- Date.toDateString
- Returns a string representing the date.
- Date.toGMTString
- Returns a string representing the date.
- Date.toLocaleString
- Returns a string representing the date.
- Date.toString
- Returns a string representing the date.
- Date.toTimeString
- Returns a string representing the date.
- Date.toUTCString
- Returns a string representing the date.
Inherited Methods
- Object.hasOwnProperty
- Checks for the existence of an object property
- Object.toLocaleString
- Returns a string that represents the object.
- Object.toString
- Returns a string that represents the object.
- Object.valueOf
- Returns the 'primitive' value of the object.
Date.UTC
- static function Date.UTC(year : Number, month : Number, day : Number, hour : Number, minute : Number, second : Number, millisecond : Number)
Arguments
- year
- The year of the Date.
- month
- The month of the Date.
- day
- The day of the Date. Optional.
- hour
- The hour of the Date. Optional.
- minute
- The minute of the Date. Optional.
- second
- The second of the Date. Optional.
- millisecond
- The millisecond of the Date. Optional.
Returns
Returns the milliseconds after 1/1/1970 00:00:00 of the date specified by the parameters. This date is interpreted to be in UTC.
Description
Returns the milliseconds after 1/1/1970 00:00:00 of the date specified by the parameters. This date is interpreted to be in UTC.
Date.getDate
- function Date.getDate() : Number
Returns
Returns the day of the month of date in local time, where the first day of the month is a 1.
Description
Returns the day of the month of date in local time, where the first day of the month is a 1.
Date.getDay
- function Date.getDay() : Number
Returns
Returns the day of the week of date in local time where 0 corresponds to Sunday and 6 corresponds to Saturday.
Description
Returns the day of the week of date in local time where 0 corresponds to Sunday and 6 corresponds to Saturday.
Date.getFullYear
- function Date.getFullYear() : Number
Returns
Returns the year of the date in local time in four-digit notation.
Description
Returns the year of the date in local time in four-digit notation.
Date.getHours
- function Date.getHours() : Number
Returns
Returns the hour of day of date in local time where 0 corresponds to midnight and 23 corresponds to 11 p.m.
Description
Returns the hour of day of date in local time where 0 corresponds to midnight and 23 corresponds to 11 p.m.
Date.getMilliseconds
- function Date.getMilliseconds() : Number
Returns
Returns the milliseconds field of the date in local time.
Description
Returns the milliseconds field of the date in local time.
Date.getMinutes
- function Date.getMinutes() : Number
Returns
Returns the minutes of the hour of the date in local time.
Description
Returns the minutes of the hour of the date in local time.
Date.getMonth
- function Date.getMonth() : Number
Returns
Returns the month of the year of date in local time. 0 means January, 11 December.
Description
Returns the month of the year of date in local time. 0 means January, 11 December.
Date.getSeconds
- function Date.getSeconds() : Number
Returns
Returns the seconds field of the date in local time.
Description
Returns the seconds field of the date in local time.
Date.getTime
- function Date.getTime() : Number
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the date.
Description
Returns the number of milliseconds between 1/1/1970 00:00:00 and the date.
Date.getTimezoneOffset
- function Date.getTimezoneOffset() : Number
Returns
Returns the number of minutes between GMT and the local time.
Description
Returns the number of minutes between GMT and the local time.
Date.getUTCDate
- function Date.getUTCDate() : Number
Returns
Returns the day of the month of date in UTC where the first day of the month is given by 1.
Description
Returns the day of the month of date in UTC where the first day of the month is given by 1.
Date.getUTCDay
- function Date.getUTCDay() : Number
Returns
Returns the day of the week of date in UTC where 0 corresponds to Sunday and 6 corresponds to Saturday.
Description
Returns the day of the week of date in UTC where 0 corresponds to Sunday and 6 corresponds to Saturday.
Date.getUTCFullYear
- function Date.getUTCFullYear() : Number
Returns
Returns the year of the date in UTC in four-digit notation.
Description
Returns the year of the date in UTC in four-digit notation.
Date.getUTCHours
- function Date.getUTCHours() : Number
Returns
Returns the hour of day of date in UTC where 0 corresponds to midnight and 23 corresponds to 11 p.m.
Description
Returns the hour of day of date in UTC where 0 corresponds to midnight and 23 corresponds to 11 p.m.
Date.getUTCMilliseconds
- function Date.getUTCMilliseconds() : Number
Returns
Returns the milliseconds of the seconds of the date in UTC.
Description
Returns the milliseconds of the seconds of the date in UTC.
Date.getUTCMinutes
- function Date.getUTCMinutes() : Number
Returns
Returns the minutes of the hour of the date in UTC.
Description
Returns the minutes of the hour of the date in UTC.
Date.getUTCMonth
- function Date.getUTCMonth() : Number
Returns
Returns the month of the year of date in UTC where 0 corresponds to January and 11 corresponds to December.
Description
Returns the month of the year of date in UTC where 0 corresponds to January and 11 corresponds to December.
Date.getUTCSeconds
- function Date.getUTCSeconds() : Number
Returns
Returns the seconds of the minute of the date in UTC.
Description
Returns the seconds of the minute of the date in UTC.
Date.getYear
- function Date.getYear() : Number
Returns
Returns the year of the date in local time in two-digit notation.
Description
Returns the year of the date in local time in two-digit notation, relative to 1900.
Date.parse
- static function Date.parse(text : String) : Number
Arguments
- text
- The text describing the date of which the milliseconds after 1/1/1970 00:00:00 are to be returned.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the date described by text.
Description
Parses the date described by text and returns the number of milliseconds between 1/1/1970 00:00:00 and that date.
Date.setDate
- function Date.setDate(day : Number) : Number
Arguments
- day
- The new day of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new day of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setFullYear
- function Date.setFullYear(year : Number) : Number
Arguments
- year
- The new year of the date in four-digit format.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new year of the date using a four-digit format and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setHours
- function Date.setHours(hour : Number) : Number
Arguments
- hour
- The new hour of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new hour of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setMilliseconds
- function Date.setMilliseconds(millisecond : Number) : Number
Arguments
- millisecond
- The new millisecond of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new millisecond of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setMinutes
- function Date.setMinutes(minute : Number) : Number
Arguments
- minute
- The new minute of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new minute of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setMonth
- function Date.setMonth(month : Number) : Number
Arguments
- month
- The new month of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new month of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setSeconds
- function Date.setSeconds(second : Number) : Number
Arguments
- second
- The new second of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new second of the date and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setTime
- function Date.setTime(milliseconds : Number) : Number
Arguments
- milliseconds
- The new number of milliseconds of the date.
Returns
Returns the new number of milliseconds of the date.
Description
Sets the new number of milliseconds between 1/1/1970 00:00:00 and the date.
Date.setUTCDate
- function Date.setUTCDate(day : Number) : Number
Arguments
- day
- The new day of the date in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new day of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCFullYear
- function Date.setUTCFullYear(year : Number) : Number
Arguments
- year
- The new year of the date in four-digit format in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new year of the date using a four-digit format in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCHours
- function Date.setUTCHours(hour : Number) : Number
Arguments
- hour
- The new hour of the date in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new hour of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCMilliseconds
- function Date.setUTCMilliseconds(millisecond : Number) : Number
Arguments
- millisecond
- The new millisecond of the date.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new millisecond of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCMinutes
- function Date.setUTCMinutes(minute : Number) : Number
Arguments
- minutes
- The new minutes of the date in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new minutes of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCMonth
- function Date.setUTCMonth(month : Number) : Number
Arguments
- month
- The new month of the date in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new month of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setUTCSeconds
- function Date.setUTCSeconds(second : Number) : Number
Arguments
- second
- The new second of the date in UTC.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new second of the date in UTC and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.setYear
- function Date.setYear(year : Number) : Number
Arguments
- year
- The new year of the date in two-digit format.
Returns
Returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Description
Sets the new year of the date using a two-digit format and returns the number of milliseconds between 1/1/1970 00:00:00 and the new date.
Date.toDateString
- function Date.toDateString() : String
Returns
Returns a string representing the date part of the date in local time.
Description
Returns a string representing the date part of the date in local time.
Date.toGMTString
- function Date.toGMTString() : String
Returns
Returns a string representing date in GMT.
Description
Returns a string representing date in GMT.
Date.toLocaleString
- function Date.toLocaleString() : String
Returns
Returns a string representing the date part of the date in local time in the local format.
Description
Returns a string representing the date part of the date in local time in the local format.
Date.toString
- function Date.toString() : String
Returns
Returns a string representing the date in local time.
Description
Returns a string representing the date in local time.
Date.toTimeString
- function Date.toTimeString() : String
Returns
Returns a string representing the time part of the date in local time.
Description
Returns a string representing the time part of the date in local time.
Date.toUTCString
- function Date.toUTCString() : String
Returns
Returns a string representing the date in UTC.
Description
Returns a string representing the date in UTC.