timex v2.1.1 Timex.Format.Time.Formatters.Humanized
Handles formatting timestamp values as human readable strings.
For formatting timestamps as points in time rather than intervals,
use Timex.format
Summary
Functions
Return a human readable string representing the time interval
Return a human readable string representing the time interval, translated to the given locale
Functions
Specs
format(Types.timestamp) :: String.t | {:error, term}
Return a human readable string representing the time interval.
Examples
iex> {1435, 180354, 590264} |> Elixir.Timex.Format.Time.Formatters.Humanized.format
"45 years, 6 months, 5 days, 21 hours, 12 minutes, 34 seconds, 590.264 milliseconds"
iex> {0, 65, 0} |> Elixir.Timex.Format.Time.Formatters.Humanized.format
"1 minute, 5 seconds"
Return a human readable string representing the time interval, translated to the given locale
Examples
iex> {1435, 180354, 590264} |> Elixir.Timex.Format.Time.Formatters.Humanized.lformat("ru_RU")
"45 года 6 месяца 5 днем 21 часа 12 минуты 34 секунды 590.264 миллисекунды"
iex> {0, 65, 0} |> Elixir.Timex.Format.Time.Formatters.Humanized.lformat("ru_RU")
"1 минута 5 секунды"