Cldr.Time.hour_format_from_locale

You're seeing just the function hour_format_from_locale, go back to Cldr.Time module for more information.
Link to this function

hour_format_from_locale(locale)

View Source

Return the preferred time format for a locale.

Arguments

Returns

  • The hour format as an atom to be used for localization purposes. The return value is used as a function name in Cldr.DateTime.Formatter

Notes

  • The hc key of the u extension is honoured and will override the default preferences for a locale or territory. See the last example below.

  • Different locales and territories present the hour of day in different ways. These are represented in Cldr.DateTime.Formatter in the following way:

SymbolMidn.MorningNoonAfternoonMidn.
h121...11121...1112
K01...1101...110
H01...111213...230
k241...111213...2324

Examples

iex> Cldr.Time.hour_format_from_locale "en-AU"
:hour_1_12

iex> Cldr.Time.hour_format_from_locale "fr"
:hour_0_23

iex> Cldr.Time.hour_format_from_locale "fr-u-hc-h12"
:hour_1_12
Link to this function

hour_format_from_locale(locale_name, backend \\ Cldr.Date.default_backend())

View Source