Date.getHours

Returns the hour for the specified date according to local time.

Method of Date

Syntax

getHours()

Parameters

None

Description

The value returned by getHours is an integer between 0 and 23.

Examples

The second statement below assigns the value 23 to the variable hours, based on the value of the Date object Xmas95.

See also

Date.getUTCHours, Date.setHours

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.