CFLib.org – Common Function Library Project

NextMonth([Date])

Last updated September 6, 2001

author

Will Belden

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));
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson