The Calendar library has functionality for comparing dates and datetimes. The Calendar.Date module has a function for getting the difference between two dates. You can for instance pass date tuples or Calendar structs to the Calendar.Date.diff/2 funciton. This will return the difference in days between the two dates. iex> Calendar.Date.diff({2016, 3, 10}, {2016, 3, 4}) 6 iex> Calendar.Date.diff({2