Kalends.Formatter

Summary

iso8601(dt)

Takes an unambiguous DateTime. Returns a string with the time in ISO 8601

strftime(dt, string)

Generate a string from a DateTime formatted by a format string. Similar to strftime known from UNIX

Functions

iso8601(dt)

Takes an unambiguous DateTime. Returns a string with the time in ISO 8601

Example

iex> Kalends.DateTime.from_erl!({{2014, 9, 26}, {17, 10, 20}}, “America/Montevideo”) |> Kalends.Formatter.iso8601 “2014-09-26T17:10:20-3:00”

strftime(dt, string)

Generate a string from a DateTime formatted by a format string. Similar to strftime known from UNIX.

Example

iex> Kalends.DateTime.from_erl!({{2014,9,6},{17,10,20}},"UTC")|>Kalends.Formatter.Strftime.strftime "%Y-%m-%e %H:%M:%S"
"2014-09-6 17:10:20"

iex> Kalends.DateTime.from_erl!({{2014,9,6},{17,10,20}},"UTC")|>Kalends.Formatter.Strftime.strftime "%d.%m.%y"
"06.09.14"