CLDRex v0.0.7 CLDRex.Time
Provide time localization for common time formats.
Summary
Functions
Shortcut for localize/3
when passed the length: "full"
option
Convert the given time into the corresponding CLDR format
Shortcut for localize/3
when passed the length: "long"
option
Shortcut for localize/3
when passed the length: "medium"
option
Shortcut for localize/3
when passed the length: "short"
option
Types
Functions
Shortcut for localize/3
when passed the length: "full"
option.
Examples
iex> CLDRex.Time.long({17, 2, 3}, :en)
"5:02:03 PM zzzz"
Convert the given time into the corresponding CLDR format.
Accepted options are:
- calendar: the calendar to use. default:
gregorian
length: the time format to use. commonly available:
full
long
medium
short
Examples
iex> {date, time} = :calendar.universal_time
{{2016, 7, 17}, {9, 38, 43}}
iex> CLDRex.Time.localize(time, :en)
"9:38:43 PM"
iex> CLDRex.Time.localize({1, 2, 3}, :en)
"1:02:03 AM"
iex> CLDRex.Time.localize({1, 2, 3}, :es)
"1:02:03"
iex> CLDRex.Time.localize({17, 2, 3}, :en)
"5:02:03 PM"
Shortcut for localize/3
when passed the length: "long"
option.
Examples
iex> CLDRex.Time.long({17, 2, 3}, :en)
"5:02:03 PM z"
Shortcut for localize/3
when passed the length: "medium"
option.
Examples
iex> CLDRex.Time.medium({17, 2, 3}, :en)
"5:02:03 PM"
Shortcut for localize/3
when passed the length: "short"
option.
Examples
iex> CLDRex.Time.short({17, 2, 3}, :en)
"5:02 PM"