Date header values (RFC 3261 §20.17), in the RFC 1123 form that SIP
requires, always in GMT:
iex> Caracola.Date.encode(~U[2010-11-13 23:29:00Z])
"Sat, 13 Nov 2010 23:29:00 GMT"
iex> Caracola.Date.parse("Sat, 13 Nov 2010 23:29:00 GMT")
{:ok, ~U[2010-11-13 23:29:00Z]}
Summary
Functions
@spec encode(DateTime.t()) :: String.t()
@spec now() :: String.t()
Returns the current time as a Date value.
@spec parse(binary()) :: {:ok, DateTime.t()} | :error
Parses a Date value. The day name is optional, as RFC 1123 allows, but
must match the date if present.