User Guide

Chapter 2: ColdFusion Functions 305
CreateODBCDate
Returns a date in ODBC date format.
See also CreateDate and CreateODBCDateTime.
Syntax CreateODBCDate(
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.
Examples <!---------------------------------------------------------
This example shows how to use CreateDate, CreateDateTime, and
createODBCdate
----------------------------------------------------------->
<HTML>
<HEAD>
<TITLE>
CreateODBCDate Example
</TITLE>
</HEAD>
<basefont face="Arial, Helvetica" size=2>
<body bgcolor="#FFFFD5">
<H3>CreateODBCDate 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