Hi Chaps,
I have a MySQL (Y-m-d H:i:s) starting date. . .
I then have a task duration in seconds/minutes
What I'm after is a task 'due' date, which falls between normal working hours (09:00 - 17:30).
PHP Code:
$task_start 2010-05-27 16:08:23;
$duration 45000// Which I guess is 12.5 hours????
$start_str strtotime($task_start);
$calc $start_str $duration;
$due_date date('Y-m-d H:i:s'$calc);
$due_date// 2010-05-28 04:38:23 
As you can see, the calculation is correct, but the time falls outside the normal working hours, so I need some sort of function to check, then re-calculate so it falls between 09:00-17:30.

Any help would be awesome!