Hello,
I want to get yesterdays date.
Is there an easy way to do it?
Because the mktime-function doesn't seam to be the best option.
Thanks,
PHP yesterday date
Re: PHP yesterday date
Hi,
mktime() works fine for me:
But you can also use the following code:
The result should be the same.
mktime() works fine for me:
Code: Select all
$yesterday=date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")));
Code: Select all
$yesterday=date("Y-m-d", time()-86400);