Calendar v1.0.0 Calendar.Time.Parse View Source
Link to this section Summary
Link to this section Functions
Link to this function
iso8601(string) View Source
Parses ISO 8601 time strings.
The function accepts both the extended and the basic format.
Examples
# Extended format
iex> iso8601("13:07:58")
{:ok, %Time{hour: 13, minute: 7, second: 58}}
# Basic format (the basic format does not have colons)
iex> iso8601("130758")
{:ok, %Time{hour: 13, minute: 7, second: 58}}
iex> iso8601("25:65:00")
{:error, :invalid_time}
Link to this function
iso8601!(string) View Source
Parses ISO 8601 time strings.
Like iso_8601/1
, but returns the result untagged and raises
in case of an error.
Examples
# Extended format
iex> iso8601!("13:07:58")
%Time{hour: 13, minute: 7, second: 58}