Calendar.ISO.parse_utc_datetime
You're seeing just the function
parse_utc_datetime
, go back to Calendar.ISO module for more information.
Parses a UTC datetime string
in the :extended
format.
For more information on supported strings, see how this module implements ISO 8601.
Examples
iex> Calendar.ISO.parse_utc_datetime("2015-01-23 23:50:07Z")
{:ok, {2015, 1, 23, 23, 50, 7, {0, 0}}, 0}
iex> Calendar.ISO.parse_utc_datetime("2015-01-23 23:50:07+02:30")
{:ok, {2015, 1, 23, 21, 20, 7, {0, 0}}, 9000}
iex> Calendar.ISO.parse_utc_datetime("2015-01-23 23:50:07")
{:error, :missing_offset}
Parses a UTC datetime 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_utc_datetime("20150123 235007Z", :basic)
{:ok, {2015, 1, 23, 23, 50, 7, {0, 0}}, 0}
iex> Calendar.ISO.parse_utc_datetime("20150123 235007Z", :extended)
{:error, :invalid_format}