Date.getHours()
Returns the hour (from 0-23)
Last updated
Returns the hour (from 0-23)
Last updated
The getHours() method returns the hour for the specified date, according to local time.
Return value
An integer number, between 0 and 23, representing the hour for the given date according to local time.
The value returned by getFullYear()
is an absolute number. For dates between the years 1000 and 9999, getFullYear()
returns a four-digit number, for example, 1995. Use this function to make sure a year is compliant with years after 2000.
getHours()
The second statement below assigns the value 23 to the variable hours
, based on the value of the object Xmas95
.
Uros Durdevic