Date.from_iso8601

You're seeing just the function from_iso8601, go back to Date module for more information.
Link to this function

from_iso8601(string, calendar \\ Calendar.ISO)

View Source

Specs

from_iso8601(String.t(), Calendar.calendar()) :: {:ok, t()} | {:error, atom()}

Parses the extended "Dates" format described by ISO 8601:2019.

The year parsed by this function is limited to four digits.

Examples

iex> Date.from_iso8601("2015-01-23")
{:ok, ~D[2015-01-23]}

iex> Date.from_iso8601("2015:01:23")
{:error, :invalid_format}

iex> Date.from_iso8601("2015-01-32")
{:error, :invalid_date}