hour

Extracts the hour of the day from a date/time object.
Ordinal value of the hour, in the range 0 - 23.

hour(date) → returns numeric

Member Function Syntax

date.hour()

hour Argument Reference

date date
Required

Compatibility

ColdFusion:

Member function is available in CF11+.

Lucee:

Member function is available in Lucee4.5+.

Examples sample code invoking the hour function

dt = createdatetime(2016,1,1,5,30,25);
h = hour( dt );
writeoutput( h );

Expected Result: 5

hour( now() )

Fork me on GitHub