+ Start a Discussion
The new LearnerThe new Learner 

how to convert milliseconds to date

HI Experts,

i am trying to get the difference between two dates using business hours difference method like below to exclude holidays and weeknds while converting milliseconds in to date i am not getting anything can anyone help please.
 
here is method


 long temp= BusinessHours.diff(
                            ri.Completion_Date__c,
                            ri.Completion_Date__c-3,
                            businessHoursId);

output: DEBUG|temp-1020 

DateTime gmtDatetime = DateTime.newInstance(temp);

output: gmtDatetime1969-12-31 23:59:58

 
Danish HodaDanish Hoda
Hi there,
May I know what's logic in 
ri.Completion_Date__c-3

If you want to subtract 3 days from the ri.Completion_Date__c , please try using ri.Completion_Date__c.addDays(-3)