ich hab das bei mir drin und es funktioniert:
(PS: ich glaub das wurde hier schon einmal gepostet - aber ich mach es einfach nochmal)
// friendly date mod\\*******************
$thetime = (!empty($translate)) ? strtr(@gmdate($format, $gmepoch + (7200 * $tz)), $translate) : @gmdate($format, $gmepoch + (7200 * $tz));
$L_Today = '<b>Heute</b> um';
$L_Yesterday = '<b>Gestern</b> um';
$time_format = " H:i";
$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];
$forum_date_today = @gmdate ("d", $gmepoch + (7200 * $tz));
$forum_date_month = @gmdate ("m", $gmepoch + (7200 * $tz));
$forum_date_year = @gmdate ("Y", $gmepoch + (7200 * $tz));
if($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
{
//today
$thetime = $L_Today . @gmdate ($time_format, $gmepoch + (7200 * $tz));
}
else
{
if($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
{
//yesterday
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (7200 * $tz));
}
else
{
//if today is 1 and the month is not 1, then we have to check how many days in the
// previews month and then set $yesterday to the last day in the previews month
if($today == 1 && $month != 1)
{
//returns how many days in the previews month
$yesterday = date ("t", gmmktime(0,0,0,($month-1),1,$year) + (7200 * $tz));
if($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
{
//yesterday
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (7200 * $tz));
}
}
else
{
//if we are in the first day in the year
if($today == 1 && $month == 1)
{
$yesterday = date("t", gmmktime(0,0,0,12,1,($year -1)) + (7200 * $tz));
if($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
{
//yesterday
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (7200 * $tz));
}
}
}
}
}
return($thetime);
}
//end friendly date \\*******************************