Calculates the number of days between two dates