Calculate the difference between two DateTimes in Salesforce

In Formula Calculate the second difference between two DateTimes. In Visualforce Page Calculate the second difference between two DateTimes. In Apex ※A “Date/time arithmetic expressions must use Integer, Decimal or Double arguments” error will be occurred, when we subtract between two DateTimes directly like Formula.

read more