getHours

Commons
stable

Returns the hour (0–23) for a given Date object. Thin wrapper around Date.prototype.getHours() used by the TimePicker component.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
A JavaScript Date instance from which the hour value is extracted.

API

Return value

The value returned by this util.

Integer between 0 and 23 representing the hour of the day in local time.

Usage

Examples

Ready-to-paste usage snippets.

Extract hour from a Date

typescript