iex(14)> today = Date.utc_today()
~D[2018-02-22]
iex(15)> now = Time.utc_now()
~T[10:40:25.547910]
iex(16)> naive = NaiveDateTime.new(today, now)
{:ok, ~N[2018-02-22 10:40:25.547910]}
iex(17)> NaiveDateTime.to_iso8601(naive)
** (ArgumentError) NaiveDateTime.to_iso8601/2 expects format to be :extended or :basic, got: :extended
(elixir) lib/calendar/naive_datetime.ex:567: NaiveDateTime.to_iso8601/2
The problem is obviously that I’m sending tuple {:ok, datetieme}
instead of just datetime
to NaiveDateTime.to_iso8601
but the error indicates that problem is somewhere else.
And although I would like to send a PR, i really don’t know how to fix it
Here’s code in source: https://github.com/elixir-lang/elixir/blob/2d4be9850b04ded001d73464c66c04ffcd00bcce/lib/elixir/lib/calendar/naive_datetime.ex#L551
Anyone has clue how to fix the error message from elixir?