Cldr.DateTime.Formatter.hour_1_24

You're seeing just the function hour_1_24, go back to Cldr.DateTime.Formatter module for more information.
Link to this function

hour_1_24(hour_1_24, n \\ 1, options \\ [])

View Source

Specs

hour_1_24(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

Format Symbol

The representation of the hour is made in accordance with the following table:

SymbolMidn.MorningNoonAfternoonMidn.
k241...111213...2324

Examples

iex(4)> Cldr.DateTime.Formatter.hour_1_24 %{hour: 0}
"24"

iex(5)> Cldr.DateTime.Formatter.hour_1_24 %{hour: 12}
"12"

iex(6)> Cldr.DateTime.Formatter.hour_1_24 %{hour: 13}
"13"

iex(7)> Cldr.DateTime.Formatter.hour_1_24 %{hour: 9}
"9"

iex(8)> Cldr.DateTime.Formatter.hour_1_24 %{hour: 24}
"24"
Link to this function

hour_1_24(time, n, locale, backend, options \\ [])

View Source

Specs

hour_1_24(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) ::
  String.t() | {:error, String.t()}