<CFSET nextmonth=DateAdd("m", 1, Now())>
<CFSET lastmonth=DateAdd("m", -1, Now())>

Then use DateFormat() to display as needed.




-----Original Message-----
From: Josh R [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 12, 2001 11:34 PM
To: CF-Talk
Subject: Simple Date Question


This is easy, but I'm curious to know if anyone has an easier way to do this
then I do.

I have to assign values for %lastmonth% and %nextmonth% that also keeps the
year in mind. In others words, in December 2001, %nextmonth%= January 2002,
and in January 2002, %lastmonth% equates to December 2001. (I know I'm tired
when I can't figure a better way to say this)

What is the simplest way to do this, keeping in mind changing years as well?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to