Difference between 2 datetimes in Salesforce

cafeforce
cafeforce 9.4k Views Add a Comment

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 … 🙂

Share This Article
Leave a comment
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments