Chapter 2: ColdFusion Functions
Hour
Returns the ordinal value for the hour, ranging from 0 to 23.
See also DatePart, Minute, and Second.
Syntax
Hour( date )
date
Any date.
Usage
Years from 0 to 29 are interpreted as 21
th
as 20
century values.
When passing a date/time value as a string, make sure it is enclosed in quotes.
Otherwise, it is interpreted as a number representation of a date/time object, returning
undesired results.
Examples
<!--- This example shows the use of Hour, Minute, and Second --->
<HTML>
<HEAD>
<TITLE>
Hour Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>Hour Example</H3>
<CFOUTPUT>
The time is currently #TimeFormat(Now())#.
We are in hour #Hour(Now())#, Minute #Minute(Now())#
and Second #Second(Now())# of the day.
</CFOUTPUT>
</BODY>
</HTML>
st
century values. Years 30 to 99 are interpreted
373
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?