yesterday php
date('F j, Y',strtotime("-1 days"));
yesterday php
date('F j, Y',strtotime("-1 days"));
php yesterday
$yesterday = new DateTime('yesterday');
echo $yesterday->format('Y-m-d');
php strtotime 1 day ago from
date('Y-m-d', strtotime('+1 day', strtotime($date)))
yesterday php
date("F j, Y", time() - 86400);
check if given date time is of today or yesterday php
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;
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us