I'm using the following code to calculate a date during a business week:
function DateAddBusinessDays($i){
$d = mktime(date('g'),date('i'),0,date('n'),date('j'),date('Y')) ;
do {
$d = mktime(date('g',$d),date('i',$d),0,date('n',$d),date('j',$d)+1,date('Y',$d)) ;
$dow = date('D',$d);
switch ($dow) {
case 'Sat':
case 'Sun':
break;
default:
$i--;
}
} while ($i>0);
return $d;
}
Works well except that it always shows "a.m." instead of correctly showing "a.m." or "p.m" as needed. What is the problem here?
oh yeah, I'm formatting the date thusly:
$d = date("F j, Y, g:i a" , $d);