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.
Return the preferred time format for a locale.
Arguments
language_tagis any language tag returned byCldr.Locale.new/2or anylocale_namereturned byCldr.known_locale_names/1
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
hckey of theuextension 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.Formatterin the following way:
| Symbol | Midn. | Morning | Noon | Afternoon | Midn. |
|---|---|---|---|---|---|
| h | 12 | 1...11 | 12 | 1...11 | 12 |
| K | 0 | 1...11 | 0 | 1...11 | 0 |
| H | 0 | 1...11 | 12 | 13...23 | 0 |
| k | 24 | 1...11 | 12 | 13...23 | 24 |
Examples
iex> Cldr.Time.hour_format_from_locale "en-AU"
:h12
iex> Cldr.Time.hour_format_from_locale "fr"
:h23
iex> Cldr.Time.hour_format_from_locale "fr-u-hc-h12"
:h12
Link to this function