Returns the hours portion of a date object.

Syntax

<oRef>.getHours( )

<oRef>

The date object whose hours you want to return.

Property of

Date

Description

The getHours( ) method returns the hours portion of the time (using a 24-hour clock) in a Date object: an integer from 0 to 23.