> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hour

# \$hour

The `$hour` operator extracts the hour component from a date object (0-23).

## Input

* A single date object

## Output

* The hour component of the date as an integer (0-23)

## Examples

### Extract Hour from Date

```json theme={null}
{
  "$hour": [
    {
      "$toDate": ["2023-01-15T10:30:00Z"]
    }
  ]
}
```

Result: `10`

### Extract Hour from Field

```json theme={null}
{
  "$hour": [
    {
      "$input": "event_date"
    }
  ]
}
```

Result: The hour component (0-23) of the event\_date field
