month

Extracts the month value from a date/time object.

month(date) → returns Numeric

Member Function Syntax

date.month()

Argument Reference for the month function

date

Required: Yes
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 month function


Month of a datatime object

dt = createdatetime(2016,1,1,5,30,25);
m = month( dt );
writeoutput( m );

Expected Result: 1


Fork me on GitHub