Extracts the year component from a timestamp.
year(x: time) -> int
Description
Section titled “Description”The year
function extracts the year component from a timestamp as an integer.
x: time
Section titled “x: time”The timestamp from which to extract the year.
Examples
Section titled “Examples”Extract the year from a timestamp
Section titled “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,}