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).
Code: Select all
$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);
echo $due_date; // 2010-05-28 04:38:23Any help would be awesome!