Elixir Date.diff/2 is undefined or private

Viewed 591

I am new to Elixir and trying to run some scripts from elixir documentation, testing Date structure gave a strange result because Date.compare(~D[2016-04-16], ~D[2016-04-28]) is returning :lt while when trying to run Date.diff(~D[2016-04-16], ~D[2016-04-28]) I am getting this error

(UndefinedFunctionError) function Date.diff/2 is undefined or private
(elixir) Date.diff(~D[2016-04-16], ~D[2016-04-28])
2 Answers
Related