WeekInMonth([theDate])
Last updated September 21, 2004
Version: 1 | Requires: CF5 | Library: DateLib
Description:
Returns the week number in a month. I.E: The week number of March 27, 2004 would be 4
Return Values:
Returns a number.
Example:
<cfset weekNum = weekInMonth(Now())>
Parameters:
Name | Description | Required |
---|---|---|
theDate | Date to use. Defaults to now(). | No |
Full UDF Source:
/**
* Returns the week number in a month.
*
* @param theDate Date to use. Defaults to now(). (Optional)
* @return Returns a number.
* @author Casey Broich (cab@pagex.com)
* @version 1, September 21, 2004
*/
function weekInMonth() {
var theDate = Now();
if(arrayLen(arguments)) theDate = arguments[1];
return week(theDate) - week(createDate(year(theDate),month(theDate),1)) + 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