# `Caracola.Date`
[🔗](https://github.com/netkubes/caracola/blob/v0.1.0-rc.1/lib/caracola/date.ex#L1)

`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]}

# `encode`

```elixir
@spec encode(DateTime.t()) :: String.t()
```

Encodes a `DateTime` (converted to UTC) as a `Date` value.

# `now`

```elixir
@spec now() :: String.t()
```

Returns the current time as a `Date` value.

# `parse`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
