Chapter 2: ColdFusion Functions
307
CreateODBCDateTime
Returns a date/time object in ODBC timestamp format.
See also
CreateDateTime
,
CreateODBCDate
,
CreateODBCTime
, and
Now
.
Syntax
CreateODBCDateTime
(
date)
date
Date/time object in the period from 100 AD to 9999 AD. Years from 0 to 29 are
interpreted as 21
st
century values. Years 30 to 99 are interpreted as 20
th
century
values.
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 example shows how to use CreateDate, CreateDateTime, and
createODBCDateTime
----------------------------------------------------------->
<HTML>
<HEAD>
<TITLE>
CreateODBCDateTime Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>CreateODBCDateTime Example</H3>
<CFIF IsDefined("FORM.year")>
Your date value, presented using different CF date functions:
<CFSET yourDate = CreateDateTime(FORM.year, FORM.month, FORM.day,
FORM.hour, FORM.minute, FORM.second)>
<CFOUTPUT>
<UL>
<LI>Built with CreateDate:
#CreateDate(FORM.year, FORM.month, FORM.day)#
<LI>Built with CreateDateTime:
#DateFormat(CreateDateTime(FORM.year, FORM.month, FORM.day,
FORM.hour, FORM.minute, FORM.second))#
<LI>Built with CreateODBCDate: #CreateODBCDate(yourDate)#
<LI>Built with CreateODBCDateTime: #CreateODBCDateTime(yourDate)#
</UL>
<P>The same value can be formatted with dateFormat:
<UL>
<LI>Built with CreateDate:
#DateFormat(CreateDate
(FORM.year, FORM.month, FORM.day), "mmm-dd-yyyy")#
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...