@@ -171,8 +171,7 @@ defmodule Date do
171171 As specified in the standard, the separator "T" may be omitted if
172172 desired as there is no ambiguity within this function.
173173
174- Time representations with reduced accuracy and decimal fractions
175- are not supported.
174+ Time representations with reduced accuracy are not supported.
176175
177176 ## Examples
178177
@@ -418,8 +417,7 @@ defmodule Time do
418417 As specified in the standard, the separator "T" may be omitted if
419418 desired as there is no ambiguity within this function.
420419
421- Time representations with reduced accuracy and decimal fractions
422- are not supported.
420+ Time representations with reduced accuracy are not supported.
423421
424422 ## Examples
425423
@@ -736,8 +734,7 @@ defmodule NaiveDateTime do
736734 As specified in the standard, the separator "T" may be omitted if
737735 desired as there is no ambiguity within this function.
738736
739- Time representations with reduced accuracy and decimal fractions
740- are not supported.
737+ Time representations with reduced accuracy are not supported.
741738
742739 ## Examples
743740
@@ -766,6 +763,19 @@ defmodule NaiveDateTime do
766763 iex> NaiveDateTime.from_iso8601("2015-01-32 23:50:07")
767764 {:error, :invalid_date}
768765
766+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123+02:30")
767+ {:ok, ~N[2015-01-23 23:50:07.123]}
768+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123+00:00")
769+ {:ok, ~N[2015-01-23 23:50:07.123]}
770+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123-02:30")
771+ {:ok, ~N[2015-01-23 23:50:07.123]}
772+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123-00:00")
773+ {:error, :invalid_format}
774+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123-00:60")
775+ {:error, :invalid_format}
776+ iex> NaiveDateTime.from_iso8601("2015-01-23T23:50:07.123-24:00")
777+ {:error, :invalid_format}
778+
769779 """
770780 @ spec from_iso8601 ( String . t ) :: { :ok , NaiveDateTime . t } | { :error , atom }
771781 def from_iso8601 ( << year :: 4 - bytes , ?- , month :: 2 - bytes , ?- , day :: 2 - bytes , sep ,
0 commit comments