NextMonth([Date])
Last updated September 06, 2001
Version: 1 | Requires: CF5 | Library: DateLib
Description:
Returns a date object representing the first day of the next month. Optional parameters allows you to provide the date you want to calculate the next month from.
Return Values:
Returns a date object.
Example:
<CFOUTPUT>
Next Month begins on #DateFormat(NextMonth())#
</CFOUTPUT>
Parameters:
Name | Description | Required |
---|---|---|
Date | Date object to go to the next month on. Defaults to now. | No |
Full UDF Source:
/**
* Returns a date object representing the first day of the next month.
* Version 2 by Raymond Camden
*
* @param Date Date object to go to the next month on. Defaults to now.
* @return Returns a date object.
* @author Will Belden (wbelden@dwo.net)
* @version 1, September 6, 2001
*/
function NextMonth() {
var db = iif(arrayLen(arguments),"arguments[1]","now()");
return DateAdd("m",1,CreateDate(Year(db), Month(db), 1));
}
Search CFLib.org
Latest Additions
Raymond Camden added
QueryDeleteRows
November 04, 2017
Leigh added
nullPad
May 11, 2016
Raymond Camden added
stripHTML
May 10, 2016
Kevin Cotton added
date2ExcelDate
May 05, 2016
Raymond Camden added
CapFirst
April 25, 2016