getHour
The getHour() function returns the hour (0–23) of a TheDate, adjusted by an optional timezone.
Interactive example
Syntax
typescript
function getHour<
GenericInput extends TheDate
>(
input: GenericInput,
timezone?: Timezone
): numberParameters
input:TheDatevalue.timezone: Timezone (optional).
Return value
An integer between 0 and 23.
