subtracting Dates
| From: | Mike Mike | Date: | Tue, 01 May 2001 19:28:47 +0000 |
| Subject: | subtracting Dates | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-50996@lists.php.net to get a copy of this message | ||
Hello,
I am trying to make a hit counter graph that will have
7 days to it. Monday thru Friday.
I'm having problems getting the last 7 days.
For instance today is 05-01-2001 I would like to
determan the previous 7 days from that date. In VB
Date - 7 = 04-24-2001 I would like this to work for
any date using php.
Here is what I have so far...
$t = (date ("m-d-Y"));
echo $t; // output 05-01-2001
echo "<br>";
$r = $t - 7;
echo $r; //output -2
but now $r returns -2
How do I get $r to yesterdays date in this format.
04-30-2001
Thank you
--Mike
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/