function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vmkIAA
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008mR5IAI
BusinessHours.diff(String businessHoursId, Datetime startDate, Datetime endDate)
For more info you might want to just look up the BusinessHours Class in the standard Apex reference:
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
I had the code below, that maybe it could help. However I like more the use of BusinessHours class. The solution that @Martha_Senete suggested is nice. ( I clicked like on that answer :) )
-->Datetime startDate = datetime.newInstance(2014, 01, 01, 10, 0, 0 );
--> Datetime endDate = datetime.newInstance(2014, 01, 01, 18, 0, 0);
public Time calculateBusinessHours(Datetime startDate, Datetime endDate)
{
Long businessHours = endDate.getTime() - startDate.getTime();
return dateTime.newInstance(businessHours).time();
}
Anyway Hope this help too.
Kind Regards,
Carolina.