Skip to content

hour

Extracts the hour component from a timestamp.

hour(x: time) -> int

The hour function extracts the hour component from a timestamp as an integer (0-23).

The timestamp from which to extract the hour.

from {
ts: 2024-06-15T14:30:45.123456,
}
hour = ts.hour()
{
ts: 2024-06-15T14:30:45.123456,
hour: 14,
}

year, month, day, minute, second

Last updated: