I want to echo the date of today minus 1 day, how do I do this?
I am thinking its something like - needs to be in human readable format.
$yesterday = time() - 1;
echo $yesterday;
but that doesnt work
I want to echo the date of today minus 1 day, how do I do this?
I am thinking its something like - needs to be in human readable format.
$yesterday = time() - 1;
echo $yesterday;
but that doesnt work
time() is in seconds, not in days
So, $yesterday = time() - 24 * 3600
, or in PHP >= 5.3 $yesterday = new \\DateTime('-1 day');