Difference between 2 dates in Salesforce

Suyash N
Suyash N 1.4k Views Add a Comment

Calculate the difference between 2 dates easily with the below code. You can calculate the difference between 2 dates on a VF page itself or in Apex code. Salesforce provides standard methods to give the difference between 2 dates. To refer to the Salesforce Date Class Click Here.

For calculation of the difference between 2 datetimes Click Here.

To find the days between 2 date fields, Checkout the below code:

  • Visualforce Page

  • APEX

Also Check:

For any queries or suggestions, comment below.

Cheers … Happy Coding … 🙂

Share This Article
Leave a comment
Notify of
Inline Feedbacks
View all comments