Re: Problems with dates (bug?)
| From: | Nicholas Pappas | Date: | Tue, 20 Jun 2000 12:08:00 +0000 |
| Subject: | Re: Problems with dates (bug?) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2288@lists.php.net to get a copy of this message | ||
> > I seem to have run into something that I can't explain away
> > logically... so obviously it is a bug, right! :)
>
> I tested your code as is and mine advanced fine.
> I'm running php4
Thanks! I forgot to run this through in php4; the server this
will be on only has php3, so I would have been out of luck anyway. :)
I did figure out a pretty good solution (I think) using the
mktime() function... what a wonderful little function.
I break the YYYYMMDD string apart, add (or subtract) 1 from the
day and put the result back into the date string via date("Ymd"). Seems
to work well, though I don't know if the old was was more efficient or not
(if this is slower, the extra 100th or a second doesn't bother me) :)
Thanks again for the tip. I'll have to start bugging my server
more to get PHP4 installed!
Nick