Days between dates: Difference between revisions

→‎{{header|Erlang}}: Did proper assignment with list comprehension :)
(Added Go)
(→‎{{header|Erlang}}: Did proper assignment with list comprehension :))
Line 20:
 
between(DateOne,DateTwo) ->
Y1L = dateToInts(DateOne ,[1),2,3],
[Y1,M1,D1] = [ daysbetween:dateToInts(DateOne ,2X) || X <- L],
D1[Y2,M2,D2] = [ daysbetween:dateToInts(DateOne DateTwo,3X) || X <- L],
Y2 = dateToInts(DateTwo ,1),
M2 = dateToInts(DateTwo ,2),
D2 = dateToInts(DateTwo ,3),
GregOne = calendar:date_to_gregorian_days(Y1,M1,D1),
GregTwo = calendar:date_to_gregorian_days(Y2,M2,D2),
GregTwo - GregOne.
 
</lang>
Anonymous user