[PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread revDAVE
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 and previous 11 months like: 03/1/09 02/1/09 01/1/09 12/1/08

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread TG
: revDAVE c...@hosting4days.com To: php-general@lists.php.net Date: Thu, 12 Mar 2009 09:24:48 -0700 Subject: [PHP] Dynamic Date List Newbie Problem 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

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread Andrew Ballard
On Thu, Mar 12, 2009 at 12:24 PM, revDAVE c...@hosting4days.com 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

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 that

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread revDAVE
On 3/12/2009 9:39 AM, TG tg-...@gryffyndevelopment.com 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

Re: [PHP] Dynamic Date List Newbie Problem

2009-03-12 Thread revDAVE
On 3/12/2009 12:25 PM, Paul M Foster pa...@quillandmouse.com 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