Ontem Php
date('F j, Y',strtotime("-1 days"));
RedGuy12
date('F j, Y',strtotime("-1 days"));
$yesterday = new DateTime('yesterday');
echo $yesterday->format('Y-m-d');
date("F j, Y", strtotime("-1 days"));
date("m.d.y", strtotime("-1 days"));
date("j, n, Y", strtotime("-1 days"));
date("Ymd", strtotime("-1 days"));
date("j-m-y", strtotime("-1 days"));
date("D M Y", strtotime("-1 days"));
date("Y-m-d", strtotime("-1 days"));
echo date("Y-m-d", strtotime("yesterday"));
date("F j, Y", time() - 86400);
function getRangeDateString($timestamp) {
if ($timestamp) {
$currentTime=strtotime('today');
// Reset time to 00:00:00
$timestamp=strtotime(date('Y-m-d 00:00:00',$timestamp));
$days=round(($timestamp-$currentTime)/86400);
switch($days) {
case '0';
return 'Today';
break;
case '-1';
return 'Yesterday';
break;
case '-2';
return 'Day before yesterday';
break;
case '1';
return 'Tomorrow';
break;
case '2';
return 'Day after tomorrow';
break;
default:
if ($days > 0) {
return 'In '.$days.' days';
} else {
return ($days*-1).' days ago';
}
break;
}
}
}