echo doDate(time())."
";
echo doDate(time()-86400)."
";
echo doDate(time()-864000)."
";
function doDate($ts) {
if (Date("Ymd", $ts) == Date("Ymd")) {
return "Idag klockan ".Date("H:i");
} elseif (Date("Ymd", $ts) == Date("Ymd", time() - 86400)) {
return "Igår klockan ".Date("H:i", $ts);
} else {
return Date("d/m H:i");
}
}
?>