Question: how to calculate days between two dates in apex?
Answer: Integer noOfDays = startDate. daysBetween(endDate); The above formula is used to find number of days between two dates.