Cldr.Calendar.day_of_year

You're seeing just the function day_of_year, go back to Cldr.Calendar module for more information.

Specs

day_of_year(Date.t()) :: Calendar.day()

Returns the day of the year for a date.

Arguments

  • date is any Date.t()

Returns

  • a the day of the year as an integer

Examples

iex> Cldr.Calendar.day_of_year ~D[2019-01-01]
1
iex> Cldr.Calendar.day_of_year ~D[2016-12-31]
366
iex> Cldr.Calendar.day_of_year ~D[2019-12-31]
365
iex> Cldr.Calendar.day_of_year ~D[2019-52-07 Cldr.Calendar.NRF]
365
iex> Cldr.Calendar.day_of_year ~D[2012-53-07 Cldr.Calendar.NRF]
372