Re: Any easy way of finding "yesterday"...?
| From: | Harry Lau | Date: | Tue, 13 Nov 2001 09:58:21 +0000 |
| Subject: | Re: Any easy way of finding "yesterday"...? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74402@lists.php.net to get a copy of this message | ||
Oh what a big mistake...sorry!
$now = getdate();
$today = date("d-m-Y");
$yesterday =
date("d-m-Y",mktime(0,0,0,$now['mon'],$now['mday']-1,$now['year']);
echo("Today is " . $today . "and yesterday was " . $yesterday);
"Harry Lau" <l_harry@hotmail.com> wrote in message
news:20011113095158.9796.qmail@pb1.pair.com...
> Following is a solution...
>
> $now = getdate();
> $today = date("d-m-Y");
> $yesterday =
>
> date("d-m-Y",mktime(0,0,0,$today['mon'],$today['mday']-1,$today['year']);
> echo("Today is " . $today . "and yesterday was " . $yesterday);
>
> "Harry Lau" <l_harry@hotmail.com> wrote in message
> news:20011113093112.88418.qmail@pb1.pair.com...
> > It is easy to use the function getDate() to obtain the date of today.
> > But instead of writing plenty of conditions,
> > is there any easy way to get the date of yesterday?
> > Thank you.
> >
> >
>
>