Still, what if you really wanted it to be the 30th? Do we really want the engine to make this kind of assumption?
I guess the best solution would be like you said: add another incrementer. That way we would have the option: increment by month and keep the position relative to end of month, or increment by month and keep day. Francois Levesque http://blog.critical-web.com/ On Thu, Apr 2, 2009 at 11:28 AM, Tony <tonyw...@gmail.com> wrote: > > couple things... 1. its easy as pie to code around, i was actually > doing first of next month, less 1 day... which works as well > as your idea... and thanks! > > second, maybe there needs to be another incrementer, that does it > logically based on calendar month, rather than days, since > what is a month? its a begin on the 1st and end on a known variable > day. simply incrementing by a set number of days > to find the day next month is weird, since not all months have all > those days. maybe the JAVA should be smart enough to notice > that the date is an end of a month, and if the incrementer is "m", go > by calendar month, not by same day next month... right? > > tw > > On Thu, Apr 2, 2009 at 11:15 AM, Francois Levesque <cfab...@gmail.com> > wrote: > > > > That's odd, but not unexpected. Since you're starting on the 30th, it's > > adding a month to that and reduces when the month doesn't have 30 days in > > it. It's not taking the initiative of thinking you want the last day of > the > > month. > > > > Maybe this would work? > > > > <cfset date1 = '11/01/2008' /> > > <cfoutput> > > <cfloop from=1 to=6 index = i> > > <cfset date2 = dateAdd('m', i, date1) /> > > #dateFormat(date2,'mm')#/#daysInMonth( date2 > > )#/#dateFormat(date2,'yyyy')# <br /> > > </cfloop> > > </cfoutput> > > > > Francois Levesque > > http://blog.critical-web.com/ > > > > > > On Thu, Apr 2, 2009 at 11:05 AM, Tony <tonyw...@gmail.com> wrote: > > > >> > >> <cfset date1 = '11/30/2008' /> > >> <cfoutput> > >> <cfloop from=1 to=6 index = i> > >> <cfset date2 = dateAdd('m', i, date1) /> > >> #dateFormat(date2,'mm/dd/yyyy')# > <br > >> /> > >> </cfloop> > >> </cfoutput> > >> > >> very simple code. however, its behaving like i dont want it to. > >> id rather see it increment by a MONTH, not same day next month. > >> > >> the output of that code above is: > >> > >> 12/30/2008 > >> 01/30/2009 > >> 02/28/2009 > >> 03/30/2009 > >> 04/30/2009 > >> 05/30/2009 > >> > >> and i would rather it be.... > >> > >> 12/31/2008 > >> 1/31/2009 > >> 2/28/2009 > >> 3/31/2009 > >> 4/30/2009 > >> 5/31/2009 > >> > >> what should i be using? this is weird... i supply "m" to get month > >> increment, but > >> no dice... > >> > >> thanks > >> tw > >> > >> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321230 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4