Re: yesterday's day of week
| From: | Jason Wong | Date: | Sun, 18 Aug 2002 04:31:56 +0000 |
| Subject: | Re: yesterday's day of week | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113106@lists.php.net to get a copy of this message | ||
On Sunday 18 August 2002 09:38, Kenton Letkeman wrote:
> I have been able to get yesterdays date
> eg. $yesterday = date('d')-1; result is "17"
> but am having trouble getting yesterdays day of the week.
> eg. $yesterday = date('D')-1; result is "-1"
> eg. $yesterday = date('l')-1; result is "-1"
>
> Is there something I am missing?
You're trying to subtract 1 from a string.
> I cannot find the documentation on this.
I'm flabbergasted -- where did you look?
The proper way of doing this (ie getting yesterday's day of week and not
subtracting 1 from a string) is to look at the examples in manual.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Who loves not wisely but too well
Will look on Helen's face in hell,
But he whose love is thin and wise
Will view John Knox in Paradise.
-- Dorothy Parker
*/