Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Extracts the year component from a timestamp.

year(x: time) -> int

The year function extracts the year component from a timestamp as an integer.

The timestamp from which to extract the year.

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

Last updated: