Better use the Date/Time field type and then you can refer the following code to find the difference(first get the stime to a date variable called stime and etime to a date variable called etime),
Long dt1Long = stime.getTime();
Long dt2Long =etime.getTime();
Long milliseconds = dt2Long - dt1Long;
Long seconds = milliseconds / 1000;
Long minutes = seconds / 60;
Long hours = minutes / 60;
Long days = hours / 24;
>>> (( shobithapp__End_Date__c - shobithapp__Start_Date__c) *24) == this formula will give you total no of Hours between two date/time. >>> (( shobithapp__End_Date__c - shobithapp__Start_Date__c )*24*60)== this formula will give you total number of minutes between two date/time.
hope this helps you..mark it as best answer if this resolved your issue..
Hi pandey,
Better use the Date/Time field type and then you can refer the following code to find the difference(first get the stime to a date variable called stime and etime to a date variable called etime),
Regards
take two date/time fields
>>> (( shobithapp__End_Date__c - shobithapp__Start_Date__c) *24) == this formula will give you total no of Hours between two date/time.
>>> (( shobithapp__End_Date__c - shobithapp__Start_Date__c )*24*60)== this formula will give you total number of minutes between two date/time.
hope this helps you..mark it as best answer if this resolved your issue..
thanks