How to create office Time script

I am developing Help Desk application but I want to set office hours in it.
If user drop the call at 5.25Pm and call resloution time will be 2hrs then due time show the next day (if not holiday) 10.20AM .

Kindly please help me for the script.

Regards
Girish

Here’s a rough example of how you “could” do it. It doesn’t take into account the day of the week (weekends, etc) or holidays, but it should get you on the right track to making your own custom function. The date/time functions in PHP give you everything you need. If you want to hire someone to code it for you, that’s a different story.


<?php
	
	
	function setDueTime()
	{
		$open = '0800'; // 8:00am
		$close = '1700'; // 5:00pm
		$responseTime = '0200'; // 2 Hours
		$now = date('Hi');
		
		if (($now + $responseTime) > $close)
		{
			// If the due time is aftern business close, add the remaining due time to the opening of next day
			return (($now + $responseTime) - $close) + $open;
		} else {
			// There's enough time to complete before close of business
			return $now + $responseTime;
		}
		
	}
?>