week

From a date/time object, determines the week number within
the year. An integer in the range 1-53; the ordinal of the
week, within the year.

week(date) → returns Numeric

Member Function Syntax

date.week()

Argument Reference for the week function

date

Required: Yes
A date/time object in the range 100 AD-9999 AD. 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 week function


Week of a datatime object

dt = createdatetime(2016,1,1,5,30,25);
w = week( dt );
writeoutput( w );

Expected Result: 1


Fork me on GitHub