Methods |
Description |
getFullYear() |
Returns year in full 4
digit format (ie: 2004). |
getYear() |
Returns the year, in 4
digit format or otherwise depending on browser. Deprecated in favor
of getFullYear(). |
getMonth() |
Returns the month. (Range
is 0-11)! |
getDate() |
Returns the day of the
month (Range is 1-31) |
getDay() |
Returns the day of the week (Range is
0-6). 0=Sunday, 1=Monday, etc. |
getHours() |
Returns the hour (Range
is 0-23). |
getMinutes() |
Returns the minutes.
(Range is 0-59). |
getSeconds() |
Returns the seconds.
(Range is 0-59). |
getMilliseconds() |
Returns the milliseconds.
(Range is 0-999). |
getTime() |
Returns the millisecond
representation of the current Date object. In the words, the number
of milliseconds between 1/1/1970 (GMT) and the current Date object. |
getTimezoneOffset() |
Returns the offset (time difference)
between Greenwich Mean Time (GMT) and local time of Date object, in
minutes. |
getUTCFullYear() |
Returns the full 4 digit
year in Universal time. |
getUTCMonth() |
Returns the month in
Universal time. |
getUTCDate() |
Returns the day of the
month in Universal time. |
getUTCDay() |
Returns the day of the
week in Universal time. |
getUTCHours() |
Returns the hour in
Universal time. |
getUTCMinutes() |
Returns the minutes in
Universal time. |
getUTCSeconds() |
Returns the seconds in
Universal time. |
getUTCMilliseconds() |
Returns the milliseconds
in Universal time. |
|
|
setFullYear(year,
[month], [day]) |
Sets the year of the Date
object. (year: 4 digit year). |
setYear(year) |
Sets the year of the Date
object. "year" can be two digits (1900 is automatically added to
it), or 4 digits. Deprecated over setFullYear() above. |
setMonth(month,
[day]) |
Sets the month of the
Date object. (month: 0-11) |
setDate(day_of_month) |
Sets the day of the month
of the Date object. (day_of_month: 1-31). |
setHours(hours,
[minutes], [seconds], [millisec]) |
Sets the hour of the Date
object. (hours: 0-23). |
setMinutes(minutes,
[seconds], [millisec]) |
Sets the minutes of the
Date object. (minutes: 0-59). |
setSeconds(seconds,
[millisec]) |
Sets the seconds of the Date
object. (seconds: 0-59). |
setMilliseconds(milli) |
Sets the milliseconds
field of the Date object. (milli: 0-999) |
setTime(milli) |
Sets the value of the
Date object in terms of milliseconds elapsed since 1/1/1970 GMT. |
setUTCFullYear(year,
[month], [day]) |
Sets the year of the Date
object in Universal time. |
setUTCMonth(month,
[day]) |
Sets the month in
Universal time. |
setUTCDate(day_of_month) |
Sets the day of the month
in Universal time. |
setUTCHours(hours,
[minutes], [seconds], [millisec]) |
Sets the hours in
Universal time. |
setUTCMinutes(minutes,
[seconds], [millisec]) |
Sets the minutes in
Universal time. |
setUTCSeconds(seconds,
[millisec]) |
Sets the seconds in
Universal time. |
setUTCMilliseconds(milli) |
Sets the milliseconds in
Universal time. |
|
|
toGMTString() |
Converts a date to a string, using the GMT conventions.
Deprecated in favor of toUTCString(). |
toLocaleString() |
Converts a date to a string, using current locale conventions. |
toLocaleDateString() |
Returns the date portion of the Date as a string, using current
locale conventions. |
toLocaleTimeString() |
Returns the time portion of the Date as a string, using current
locale conventions. |
toString() |
Converts a Date to
human-readable string. |
toUTCString() |
Converts a Date to
human-readable string, in Universal time. |
parse(datestring) |
Returns the number of milliseconds in a date string since 1/1/1970.
(datestring: a string containing the date/time to be parsed). |
UTC(year, month,
[day], [hours], [minutes], [seconds],
[milli]) |
Returns the number of milliseconds in a date string since 1/1/1970,
Universal time. |
valueOf() |
Converts a Date to
milliseconds. Same as getTime();. |