# hourOfDay {#hourofday}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`hourOfDay(X)`

## Arguments {#arguments}

**X** is a scalar/vector of type TIME, MINUTE, SECOND, DATETIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.

## Details {#details}

For each element in *X*, return a number from 0 to 23 indicating which hour of the day it falls in.

## Examples {#examples}

```
hourOfDay(00:46:12);
// output: 0

hourOfDay([2012.06.12T12:30:00,2012.10.28T17:35:00,2013.01.06T02:36:47,2013.04.06T08:02:14]);
// output: [12,17,2,8]
```

Related functions: [dayOfYear](../d/dayOfYear.md), [dayOfMonth](../d/dayOfMonth.md), [quarterOfYear](../q/quarterOfYear.md), [monthOfYear](../m/monthOfYear.md), [weekOfYear](../w/weekOfYear.md), [minuteOfHour](../m/minuteOfHour.md), [secondOfMinute](../s/secondOfMinute.md), [millisecond](../m/millisecond.md), [microsecond](../m/microsecond.md), [nanosecond](../n/nanosecond.md)

