MACROMEDIA COLFUSION MX 7-CFML Reference page 535

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

CreateODBCDate
Description
Creates an ODBC date object.
Returns
A date object, in normalized ODBC date format.
Category
Date and time functions
Function syntax
CreateODBCDate(date)
See also
,
CreateDate
CreateODBCDateTime
Parameters
Parameter
date
Usage
This function does not parse or validate values. To ensure that dates are entered and processed
correctly (for example, to ensure that a day/month/year entry is not confused with a month/day/
year entry, and so on), Macromedia recommends that you parse entered dates with the
function, using the mm-dd-yyyy mask, into three elements. Ensure that values are
DateFormat
within appropriate ranges; for example, to validate a month value, use the attributes
and
"integer"
Example
<h3>CreateODBCDate Example</h3>
<CFIF IsDefined("form.year")>
<p>Your date value, generated with CreateDateTime:
<cfset yourDate = CreateDateTime(form.year, form.month, form.day, form.hour,
form.minute, form.second)>
<cfoutput>
<ul>
<li>Formatted with CreateDate: #CreateDate(form.year, form.month, form.day)#
<li>Formatted with CreateDateTime:
#CreateDateTime(form.year, form.month, form.day, form.hour, form.minute,
form.second)#
<li>Formatted with CreateODBCDate: #CreateODBCDate(yourDate)#
<li>Formatted with CreateODBCDateTime: #CreateODBCDateTime(yourDate)#
</ul>
<p>The same value can be formatted with DateFormat:
<ul>
<li>Formatted with CreateDate and DateFormat:
#DateFormat(CreateDate(form.year,form.month, form.day), "mmm-dd-yyyy")#
<li>Formatted with CreateDateTime and DateFormat:
Description
Date or date/time object in the range 100 AD–9999 AD.
.
range = "1,12"
validate =
CreateODBCDate
535

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents