Cldr.DateTime.Formatter.hour_0_23
You're seeing just the function
hour_0_23
, go back to Cldr.DateTime.Formatter module for more information.
Specs
hour_0_23(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the formatting of the :hour
(format symbol H
) as a number
in the range 0..23 as a string.
Arguments
time
is aTime
struct or any map that contains at least the key:hour
n
is the number of digits to which:hour
is paddedlocale
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 inhour_0_23/4
Format Symbol
The representation of the hour
is made in accordance with the following
table:
Symbol | Midn. | Morning | Noon | Afternoon | Midn. |
---|---|---|---|---|---|
H | 0 | 1...11 | 12 | 13...23 | 0 |
Examples:
iex> Cldr.DateTime.Formatter.hour_0_23 %{hour: 10}
"10"
iex> Cldr.DateTime.Formatter.hour_0_23 %{hour: 13}
"13"
iex> Cldr.DateTime.Formatter.hour_0_23 %{hour: 21}
"21"
iex> Cldr.DateTime.Formatter.hour_0_23 %{hour: 24}
"0"
iex> Cldr.DateTime.Formatter.hour_0_23 %{hour: 0}
"0"
Specs
hour_0_23(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}