Cldr.DateTime.Formatter.day_of_year
You're seeing just the function
day_of_year
, go back to Cldr.DateTime.Formatter module for more information.
Specs
day_of_year(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the day of the year (symbol D
) as an integer in string
format.
Arguments
date
is aDate
struct or any map that contains at least the keys:year
,:month
,:day
and:calendar
n
in an integer between 1 and 3 that determines the format of the day of yearlocale
is any valid locale name returned byCldr.known_locale_names/0
or aCldr.LanguageTag
struct. The default isCldr.get_locale/0
options
is aKeyword
list of options. There are no options used inday_of_year/4
Format Symbol
The representation of the day of the year is made in accordance with the following table:
Symbol | Example | Cldr Format |
---|---|---|
D | 3, 33, 333 | |
DD | 03, 33, 333 | |
DDD | 003, 033, 333 |
Examples
iex> Cldr.DateTime.Formatter.day_of_year ~D[2017-01-15], 1
"15"
iex> Cldr.DateTime.Formatter.day_of_year ~D[2017-01-15], 2
"15"
iex> Cldr.DateTime.Formatter.day_of_year ~D[2017-01-15], 3
"015"
Specs
day_of_year(Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}