function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sameer TyagiSameer Tyagi 

Hi! please suggest me a code to calculate the diffrence between two datetime variable in days hours minute.

I have two datetime variable

datetime dt1 = obj.lastdate__c;
datetime dt2 = system.now();


I need to calculate  dt1 - dt2  in days hours minutes

Please suggest a sample code. Your help would be appricated.
Satish_SFDCSatish_SFDC
Hi.
this is possible.

Please check the link below for the code.
http://www.interactiveties.com/blog/2011/apex-time-duration.php

Regards,
Satish Kumar