Cldr.DateTime.Formatter.h24
You're seeing just the function
h24
, go back to Cldr.DateTime.Formatter module for more information.
Specs
h24(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the formatting of the :hour
(format symbol k
) as a number in the
range 1..24 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 inh24/4
Format Symbol
The representation of the hour
is made in accordance with the following
table:
Symbol | Midn. | Morning | Noon | Afternoon | Midn. |
---|---|---|---|---|---|
k | 24 | 1...11 | 12 | 13...23 | 24 |
Examples
iex(4)> Cldr.DateTime.Formatter.h24 %{hour: 0}
"24"
iex(5)> Cldr.DateTime.Formatter.h24 %{hour: 12}
"12"
iex(6)> Cldr.DateTime.Formatter.h24 %{hour: 13}
"13"
iex(7)> Cldr.DateTime.Formatter.h24 %{hour: 9}
"9"
iex(8)> Cldr.DateTime.Formatter.h24 %{hour: 24}
"24"
Specs
h24(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}