firstDayOfMonth

Determines the ordinal (day number, in the year) of the first day of the month in which a given date falls.

firstDayOfMonth(date) → returns numeric

Member Function Syntax

date.firstDayOfMonth()

Argument Reference

date date
Required

Date or date/time object.

Compatibility

ColdFusion:

Member function is available in CF11+.

Lucee:

Member function is available in Lucee4.5+.

Examples
Sample code invoking the firstDayOfMonth function

To determine the ordinal (day number, in the year).

<cfset Date = CreateDate(2012, 12, 12)>
<cfset result = firstDayOfMonth(Date)>
<cfoutput>#result#</cfoutput>

Expected Result: 336

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub