Calendar.ISO.parse_time
You're seeing just the function
parse_time
, go back to Calendar.ISO module for more information.
Parses a time string
in the :extended
format.
For more information on supported strings, see how this module implements ISO 8601.
Examples
iex> Calendar.ISO.parse_time("23:50:07")
{:ok, {23, 50, 7, {0, 0}}}
iex> Calendar.ISO.parse_time("23:50:07Z")
{:ok, {23, 50, 7, {0, 0}}}
iex> Calendar.ISO.parse_time("T23:50:07Z")
{:ok, {23, 50, 7, {0, 0}}}
Parses a time string
according to a given format
.
The format
can either be :basic
or :extended
.
For more information on supported strings, see how this module implements ISO 8601.
Examples
iex> Calendar.ISO.parse_time("235007", :basic)
{:ok, {23, 50, 7, {0, 0}}}
iex> Calendar.ISO.parse_time("235007", :extended)
{:error, :invalid_format}