HTML and CSS Reference
In-Depth Information
Table 9.3 Date Object Methods
Method
What It Does
getDate
Returns the day of the month (1-31)
getDay
Returns the day of the week (0-6); 0 is Sunday, 1 is Monday,
and so on
getFullYear
Returns the year with four digits
getHours
Returns the hour (0-23)
getMilliseconds
Returns the millisecond
getMinutes
Returns hours since midnight (0-23)
getMonth
Returns number of month (0-11); 0 is January, 1 is February, and
so on
getSeconds
Returns the second (0-59)
getTime
Returns number of milliseconds since January 1, 1970
getTimeZoneOffset
Returns the difference in minutes between current time on
local computer and UTC
getUTCDate()
Returns the day of the month
getUTCDay()
Returns the day of the week converted to universal time
get UTCFullYear()
Returns the year in four digits converted to universal time
getUTCHours()
Returns the hour converted to universal time
getUTCMilliseconds()
Returns the millisecond converted to universal time
parse()
Converts the passed-in string date to milliseconds since
January 1, 1970
setDate(value)
Sets day of the month (1-31)
setFullYear()
Sets the year as a four-digit number*
setHours()
Sets the hour within the day (0-23)
setHours(hr,min,sec,msec)
Sets hour in local or UTC time
setMilliseconds
Sets the millisecond*
setMinutes(min,sec, msec)
Sets minute in local time or UTC
setMonth(month,date)
Sets month in local time
setSeconds()
Sets the second
 
Search WWH ::




Custom Search