Difference between 2 datetimes in Salesforce

Calculate the difference between 2 datetimes in hours or minutes or days easily with the below tricks. You can calculate the difference in formula field or Visualforce page tag or in apex programming too. There are many other methods available in Datetime class of Salesforce to convert the Datetime values. To check out the list of the available methods Click Here.

To calculate the difference between the 2 dates Click Here.

For the difference between 2 DateTimes fields, check:

  • Formula Field

  • Visualforce Page

  • APEX

You can also use other methods available in the SF Datetime class for various DateTime conversions.

To get a specific parameter from your datetime variable, use .hour(), .minute(), .date(), .day(), .dateGMT(), etc.

 

Also Check:

For any queries or suggestions, comment below.

Cheers … Happy Coding … 🙂

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments