day

Determines the day of the month, in a date.
The ordinal for the day of the month, ranging from 1 to 31.

day(date) → returns numeric

Member Function Syntax

date.day()

Argument Reference

date date
Required

Date or datetime object (100AD-9999AD).
When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.

Compatibility

ColdFusion:

Member function is available in CF11+.

Lucee:

Member function is available in Lucee4.5+.

Examples
Sample code invoking the day function

Uses the day function to determine the day of the month

<cfset Date = CreateDate(2010, 09, 08)>
<cfset result = day(Date)>
<cfoutput>#result#</cfoutput>

Expected Result: 8

Returns the day from a datetime object

createDate( 2022, 10, 1 ).day();

Expected Result: 1

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

Fork me on GitHub