Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread revDAVE
On 3/12/2009 12:25 PM, "Paul M Foster" wrote: > Crap, I hit the wrong button and sent this only to the OP... > > On Thu, Mar 12, 2009 at 09:24:48AM -0700, revDAVE wrote: > Thanks for your help Paul - that makes sense! > > Here is working code to do it better: > > // get your starting date

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread revDAVE
On 3/12/2009 9:39 AM, "TG" wrote: > $currmonth = date("m"); > > for ($i = 1; $i <= 11; $i++) { > $m[$i] = date("m/d/y"), mktime(0,0,0,$currmonth-$i, 1, 2009)); > } > > Something like that. mktime() is remarkably flexible. If you start on > month 3 and you subtract 5, you get month = -2.

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread Paul M Foster
Crap, I hit the wrong button and sent this only to the OP... On Thu, Mar 12, 2009 at 09:24:48AM -0700, revDAVE wrote: > Hi folks, > > My goal was to create a dynamic date related list as follows: > > - take the current date (3/12/2009) > - create a new date from it which would be the *1st* of t

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread Andrew Ballard
On Thu, Mar 12, 2009 at 12:24 PM, revDAVE wrote: > Hi folks, > > My goal was to create a dynamic date related list as follows: > > - take the current date (3/12/2009) > - create a new date from it which would be the *1st* of that month - > (3/1/2009) > > - then create a list that shows the current

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread TG
$currmonth = date("m"); for ($i = 1; $i <= 11; $i++) { $m[$i] = date("m/d/y"), mktime(0,0,0,$currmonth-$i, 1, 2009)); } Something like that. mktime() is remarkably flexible. If you start on month 3 and you subtract 5, you get month = -2. So that would be -2/1/2009, which mktime will