year
Extracts the year component from a timestamp.
year(x: time) -> int
Description
The year
function extracts the year component from a timestamp as an integer.
x: time
The timestamp from which to extract the year.
Examples
Extract the year from a timestamp
from {
ts: 2024-06-15T14:30:45.123456,
}
year = ts.year()
{
ts: 2024-06-15T14:30:45.123456,
year: 2024,
}