In my template, I'm trying to display:
Today, June 17th, 2005
Yesterday, June 16th, 2005
Wednesday, June 15th, 2005
to the template, but I seem to be having a problem with the_time() function.
here is my code..
<?
$today = date("Ymd");
$yesterday = date("Ymd", time() - 86400);
$mtdate = the_time('Ymd');
if ($mtdate==$today) {
echo ('Today, ');
the_time('F j, Y');
}
elseif ($mtdate==$yesterday) {
echo ('Yesterday, ');
the_time('F j, Y');
}
else {
the_time('l, F j, Y');
}
?>
This therectically should work, but for some reason its displaying like this instead:
20050617Friday, June 17th, 2005
instead. Is there a way to fix this?
thanks