Timex.Format.Time.Formatters.Default

Handles formatting timestamp values as ISO 8601 durations as described below.

Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S. In this representation, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required, but the maximum number of digits for each element should be agreed to by the communicating parties. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.

Summary

format(timestamp)

Return a human readable string representing the time interval

Functions

format(timestamp)

Specs:

Return a human readable string representing the time interval.

Examples

iex> {1435, 180354, 590264} |> Elixir.Timex.Format.Time.Formatters.Default.format
"P45Y6M5DT21H12M34.590264S"
iex> {0, 65, 0} |> Elixir.Timex.Format.Time.Formatters.Default.format
"PT1M5S"