Re: counting with dates (help!)
| From: | Peter J. Schoenster | Date: | Wed, 09 Jan 2002 22:00:00 +0000 |
| Subject: | Re: counting with dates (help!) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79962@lists.php.net to get a copy of this message | ||
On 7 Feb 2002, at 23:21, Sander Peters wrote:
> Hello,
>
>
> This is my problem:
>
> $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y)));
> $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y)));
> echo ($today - $last_week); The result is a number like 8876
> (20020107-20011231 = 8876) But in date thinking it should be 7!
>
> How can I let php count in real days/month/years in stead of numbers?
Sanders,
I've not prorammed PHP much (Perl), but I looked in the docs and
could not find anything. I tested your above code and on my
FreeBSD box with PHP Version 4.0.6 it returned 7.
Peter
Good Perl5/mod_perl/Apache/RDBMS/Unix developer seeking work
call 901-652-2002 or email job@schoenster.com