year

year, function

def const pure year(d: date): number

Returns the Gregorian year of d.

Example

table T = with
  [| as Label, as D |]
  [| "2020-01-01", date(2020, 1, 1) |]
  [| "2019-05-01", date(2019, 5, 1) |]

show table "Years" with
  T.Label
  year(T.D) as "Year"

This outputs the following table:

Label Year
2020-01-01 2020
2019-05-01 2019

See also

User Contributed Notes
0 notes + add a note