Skip to main content
Version: Next

month

Extracts the month component from a timestamp.

month(x: time) -> int

Description

The month function extracts the month component from a timestamp as an integer (1-12).

x: time

The timestamp from which to extract the month.

Examples

Extract the month from a timestamp

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

See Also

year, day, hour, minute, second