In this tutorial you will learn how to find PHP date of yesterday in a PHP web application.
PHP date get yesterday
In this tutorial you will learn how to find PHP date of yesterday in a PHP web application. The date() return current date and strtotime() that return date in Unix timestamp (in second ) and if pass parameter "-1 day" , return one day before. The code of "php-date-get-yesterday.php" given below :
<?php $date=date('Y-m-d'); echo "Current date : ".$date."<br>"; echo "yesterday : ".date("Y-m-d", strtotime("-1 day")); ?>
Output :
[ 0 ] Comments