Re: mktime() question
| From: | Tom Rogers | Date: | Sat, 03 Aug 2002 05:02:42 +0000 |
| Subject: | Re: mktime() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110930@lists.php.net to get a copy of this message | ||
Hi,
Friday, August 2, 2002, 10:52:14 PM, you wrote:
JB> Good morning!
JB> I need to subtract months by their abbreviated month name, so shouldn't this
JB> work?
JB> print(date("M", mktime(date("M")-$i));
JB> and if I loop;
JB> Aug
JB> Jul
JB> Jun
JB> May
JB> ........
Does this help...
$now = time();
$i = 36;
while($i > 0){
echo date('M-Y',$now).'<br>';
$now = strtotime('-1 month',$now);
$i--;
}
--
regards,
Tom