Chapter 2: ColdFusion Functions
CreateODBCTime
Returns a time object in ODBC time format.
See also
Syntax
CreateODBCTime( date )
date
Date/time object in the period from 100 AD to 9999 AD.
Usage
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 code illustrates CreateTime and CreateODBCTime --->
<HTML>
<HEAD>
<TITLE>
CreateODBCTime Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>CreateODBCTime Example</H3>
<CFIF IsDefined("FORM.hour")>
Your time value, presented using different CF time functions:
<CFSET yourTime = CreateTime(FORM.hour, FORM.minute, FORM.second)>
<CFOUTPUT>
<UL>
<LI>Built with CreateTime: #TimeFormat(yourTime)#
<LI>Built with CreateODBCTime: #CreateODBCTime(yourTime)#
</UL>
<P>The same value can be formatted with timeFormat:
<UL>
<LI>Built with CreateTime: #TimeFormat(yourTime, 'hh:mm:ss')#
<LI>Built with CreateODBCTime:
</UL>
</CFOUTPUT>
</CFIF>
<CFFORM ACTION="createodbctime.cfm" METHOD="post">
<PRE>
Hour<CFINPUT TYPE="Text" NAME="hour" VALUE="16" RANGE="0,23"
MESSAGE="You must enter an hour (0-23)" VALIDATE="integer"
REQUIRED="Yes">
Minute<CFINPUT TYPE="Text" NAME="minute" VALUE="12" RANGE="0,59"
CreateODBCDateTime
and CreateTime.
#TimeFormat(yourTime, 'hh:mm:sstt')#
309
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?