macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: How to find first and last day of previous month?.

Subject: Re: How to find first and last day of previous month?.
From: "sanman"
Date: Wed, 8 Aug 2007 17:50:47 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
Another way to do it would be

 <cfset nextmonth= #dateadd("M", 1, now())#>
 <cfset lastmonth= #dateadd("M", -1, now())#>


 <cfoutput>
 Previous month: #month(lastmonth)#/1/#year(lastmonth)# -  
#month(lastmonth)#/#daysinmonth(lastmonth)#/#year(lastmonth)#
 <br>
 Cur month to end of next month: #month(now())#/1/#year(now())# to 
#month(nextmonth)#/#daysinmonth(nextmonth)#/#year(nextmonth)#
 </cfoutput>


<Prev in Thread] Current Thread [Next in Thread>