Cldr.DateTime.Formatter.hour_1_12
You're seeing just the function
hour_1_12
, go back to Cldr.DateTime.Formatter module for more information.
Specs
hour_1_12(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 1..12 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_1_12/4
Format Symbol
The representation of the hour
is made in accordance with the following
table:
Symbol | Midn. | Morning | Noon | Afternoon | Midn. |
---|---|---|---|---|---|
h | 12 | 1...11 | 12 | 1...11 | 12 |
Examples
iex> Cldr.DateTime.Formatter.hour_1_12 %{hour: 0}
"12"
iex> Cldr.DateTime.Formatter.hour_1_12 %{hour: 12}
"12"
iex> Cldr.DateTime.Formatter.hour_1_12 %{hour: 24}
"12"
iex> Cldr.DateTime.Formatter.hour_1_12 %{hour: 11}
"11"
iex> Cldr.DateTime.Formatter.hour_1_12 %{hour: 23}
"11"
Specs
hour_1_12(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}