@@ -171,8 +171,7 @@ defmodule Date do
171
171
As specified in the standard, the separator "T" may be omitted if
172
172
desired as there is no ambiguity within this function.
173
173
174
- Time representations with reduced accuracy and decimal fractions
175
- are not supported.
174
+ Time representations with reduced accuracy are not supported.
176
175
177
176
## Examples
178
177
@@ -418,8 +417,7 @@ defmodule Time do
418
417
As specified in the standard, the separator "T" may be omitted if
419
418
desired as there is no ambiguity within this function.
420
419
421
- Time representations with reduced accuracy and decimal fractions
422
- are not supported.
420
+ Time representations with reduced accuracy are not supported.
423
421
424
422
## Examples
425
423
@@ -736,8 +734,7 @@ defmodule NaiveDateTime do
736
734
As specified in the standard, the separator "T" may be omitted if
737
735
desired as there is no ambiguity within this function.
738
736
739
- Time representations with reduced accuracy and decimal fractions
740
- are not supported.
737
+ Time representations with reduced accuracy are not supported.
741
738
742
739
## Examples
743
740
@@ -766,6 +763,19 @@ defmodule NaiveDateTime do
766
763
iex> NaiveDateTime.from_iso8601("2015-01-32 23:50:07")
767
764
{:error, :invalid_date}
768
765
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
+
769
779
"""
770
780
@ spec from_iso8601 ( String . t ) :: { :ok , NaiveDateTime . t } | { :error , atom }
771
781
def from_iso8601 ( << year :: 4 - bytes , ?- , month :: 2 - bytes , ?- , day :: 2 - bytes , sep ,
0 commit comments