How to find number of days between two dates using Apex in Salesforce?

The below method daysBetween is used to find number of days between two dates.

Integer noOfDays = startDate.daysBetween(endDate);

Leave a Reply