$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
10
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
$hour operator extracts the hour component from a date object (0-23).
{
"$hour": [
{
"$toDate": ["2023-01-15T10:30:00Z"]
}
]
}
10
{
"$hour": [
{
"$input": "event_date"
}
]
}
