<?php // current time in PHP $datetime = date("Y-m-d "); // print current time echo $datetime; echo " "; //After using of strotime fuction then result $yesterday = date("Y-m-d", strtotime("yesterday")); echo $yesterday; ?>