dayOfWeek

Determines the day of the week, in a date. Returns the ordinal for the day of the week, as an integer in the range 1 (Sunday) to 7 (Saturday).

dayOfWeek(date) → returns Numeric

Member Function Syntax

date.dayOfWeek()

dayOfWeek Argument Reference

date
Required

Date or date/time object. Values:
  • now()

Compatibility

ColdFusion:

Member function is available in CF 11+.

Lucee:

Member function is available in Lucee 4.5+.

Examples sample code invoking the dayOfWeek function


Determines the day of the week

Uses the dayOfWeek function to determine the day of the week

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

Expected Result: 4


Fork me on GitHub