Search
 
SCRIPT & CODE EXAMPLE
 

PHP

yesterday php

date('F j, Y',strtotime("-1 days"));
Comment

php yesterday

$yesterday = new DateTime('yesterday');
echo $yesterday->format('Y-m-d');
Comment

php yesterday date

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"));
Comment

get yesterday date in php

echo date("Y-m-d", strtotime("yesterday")); 
Comment

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;
        }
    }
}
Comment

yesterday php

date("F j, Y", time() - 86400);
Comment

PREVIOUS NEXT
Code Example
Php :: phpMyAdmin is not able to cache templates 
Php :: session_destroy not working 
Php :: php get user ip address 
Php :: php remove characters not numbers or letters 
Php :: laravel carbon count days between dates 
Php :: php decode html special characters 
Php :: pdo connexion 
Php :: is php and javascript similar 
Php :: put img in timestamp using php 
Php :: How to check current URL inside @if statement in Laravel 
Php :: php reindex array after unset 
Php :: laravel controller return message 
Php :: cakephp 404 exception 
Php :: convert string to decimal php 
Php :: old function use in checkbox selected in laravel blade 
Php :: whereyear laravel 
Php :: pdo fetch 
Php :: wordpress logout redirect to home 
Php :: group routes in laravel 
Php :: twig limit text 
Php :: laravel log permission denied mac 
Php :: how to run symfony project 
Php :: datetime format laravel 
Php :: check if value exists in object php 
Php :: laravel migration set default value 
Php :: link js file in php 
Php :: extract all arrays from sql response in php 
Php :: How to get the current date in PHP? 
Php :: stack once laravel 
Php :: php filter name 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =