Thanks for suggesting the changes. I tried them but that didn't fix the problem. Anyway, I've looked further at the code and made the following changes and that seems to have done it:
Before the convert_date() function:
if(!isset($GLOBALS['timeDiff'])) $currentTime=time(); else $currentTime=time()+$GLOBALS['timeDiff'];
$GLOBALS['today']=date('Y-m-d', $currentTime);
$GLOBALS['yesterday']=date('Y-m-d', $currentTime-86400);
and then within the convert_date() function itself:
$dfval=strtotime($dateR);
if(isset($GLOBALS['timeDiff']) and $GLOBALS['timeDiff']!=0) $dfval+=$GLOBALS['timeDiff'];
$dateR1 = date('Y-m-d H:i:s', $dfval);
if(isset($GLOBALS['dateOnlyFormat']) and isset($GLOBALS['l_today']) and isset($GLOBALS['l_yesterday'])) {
if(substr($dateR1, 0, 10)==$GLOBALS['today']) $dateR=$GLOBALS['l_today'].', '.date($GLOBALS['timeOnlyFormat'], $dfval);
elseif(substr($dateR1, 0, 10)==$GLOBALS['yesterday']) $dateR=$GLOBALS['l_yesterday'].', '.date($GLOBALS['timeOnlyFormat'], $dfval);
else $dateR=date($GLOBALS['dateFormat'], $dfval);
}
else $dateR=date($GLOBALS['dateFormat'], $dfval);
__