Esc

first_of_year

procedureextensionsince 0.36.1Source
  • macOS: first_of_year works on macOS
  • Linux: first_of_year works on Linux
  • Windows: first_of_year works on Windows
  • Wasm: first_of_year works on Wasm

Returns 1 January of the validated date's year.

Signature

first_of_year :: (value: Date) -> Date
Example↗
d := first_of_year(Date.{ 2024, 3, 15 });
assert(d.month == 1 && d.day == 1);

See also