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
Ferdy Reyes 3Ferdy Reyes 3 

How to know how many hours in a day of BusinessHours record

I need to be able to dynamically get how many hours in a day of BusinessHours record. I need to be able to do it dynamically. How do I do it?
This is sample code of what I am doing:
 

Map<String,BusinessHours>bhMap = new Map<String,BusinessHours>();
...
decimal result = BusinessHours.diff(bhMap.get(key).Id,DateTime1,DateTime2);
decimal numOfDay = result / (1000*60*60* x);
//where x should be the num of hours per business day based on Businesshours
Is it possible?
pandu ranga 16pandu ranga 16
Hi 
Please Check This Line 

https://opfocus.com/blog/business-hours-calculations-with-apex/


Thank you