HTML and CSS Reference
In-Depth Information
Date Object
The Date object is used to access the system time and date. The Date object methods
are summarized in Table G-10.
Table G-10 Date Object
Method
Returns
Method
Sets
getDate()
Day of month of Date object
setDate()
Day of month of Date object
getDay()
Day of week of Date object
setFullYear()
Four-digit year of Date object
getFullYear()
Year of Date object (four-digit
format)
setHours()
Hours of Date object
getHours()
Hour of Date object
setMilliseconds()
Milliseconds of Date object
getMilliseconds()
Milliseconds of Date object
setMinutes()
Minutes of Date object
getMinutes()
Minutes of Date object
setMonth()
Month of Date object
getMonth()
Month of Date object
setSeconds()
Seconds of Date object
getSeconds()
Seconds of Date object
setTime()
Time of Date object
(as number of milliseconds
since January 1, 1970)
getTime()
Time of Date object
(as number of milliseconds
since January 1, 1970)
setUTCDate()
Date of Date object in
universal time
getTimezoneOffset()
Local time zone offset in minutes
from the current date and GMT
setUTCFullYear()
Four-digit year of Date object
in universal time
getUTCDate()
Date of Date object in universal
time
setUTCHours()
Hours of Date object in
universal time
getUTCDay()
Day of week of Date object in
universal time
setUTCMilliseconds()
Milliseconds of Date object in
universal time
getUTCFullYear()
Four-digit year of Date object in
universal time
setUTCMinutes()
Minutes of Date object in
universal time
getUTCHours()
Hours of Date object in
universal time
setUTCMonth()
Month of Date object in
universal time
getUTCMilliseconds()
Milliseconds of Date object in
universal time
setUTCSeconds()
Seconds of Date object in
universal time
getUTCMinutes()
Minutes of Date object in
universal time
getUTCMonth()
Month of Date object in
universal time
getUTCSeconds()
Seconds of Date object in
universal time
Method
Converts
parse()
Parses a date into component
pieces (in milliseconds)
toDateString()
Returns a date as a string in
current time zone
toLocaleDateString()
Date as string value in current
time zone
toLocaleString()
Date object to string, set to the
current time zone
toLocaleTimeString()
Time as string value in current
time zone
toString()
Date object to string
Search WWH ::




Custom Search