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
Abel PalmaAbel Palma 

Operating Hours

Hi everyone, I'm trying to set the Operating Hours, but I not able to see it. 
What can I do to set this Operating hour?
I was looking for in Setup and in the Tab but I could not see it. 
 
Rahul Chaudhary OfficialRahul Chaudhary Official
Hi,

In Company Information there is a setting called Business Hours.

 
Raj VakatiRaj Vakati
To set business hours:
  • From Setup, enter Business Hours in the Quick Find box, then select Business Hours.
  • Click New Business Hours.
  • Type a name for the business hours.
  • We recommend using a name that will remind users of a location or time zone when they view business hours on a case, entitlement process, or milestone. For example, if your business hours are for a support center in San Francisco, you could use the name San Francisco Business Hours.
  • Click Active to allow users to associate the business hours with cases, escalation rules, milestones, and entitlement processes.
  • Optionally, click Use these business hours as the default to set the business hours as the default business hours on all new cases.
  • Default business hours on cases can be updated with business hours on escalation rules if the cases match escalation rule criteria and the rule is set to override business hours.
  • Choose a time zone to associate with the business hours in the Time Zone drop-down list.
  • Set your business hours for each day of the week.
  • If your support team is available during the entire day every day of the week, select the 24 hours checkbox.
  • Choose the start and end times for the business hours. If the time you want isn’t available, click the field and type it in.
  • Leave the business hours start and end times blank and the 24 hours checkbox deselected to indicate that the support team is not available at all that day.
  • Click Save.
https://help.salesforce.com/articleView?id=customize_supporthours.htm&type=5


In Apex you can use as shown below
 
// Get the default business hours
BusinessHours bh = [SELECT Id FROM BusinessHours WHERE IsDefault=true];

// Create Datetime on May 28, 2013 at 1:06:08 AM in the local timezone.
Datetime targetTime = Datetime.newInstance(2013, 5, 28, 1, 6, 8);

// Find whether the time is within the default business hours
Boolean isWithin= BusinessHours.isWithin(bh.id, targetTime);
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_businesshours.htm