Createodbcdatetime - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

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
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:
<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:
st
century values. Years 30 to 99 are interpreted as 20
#DateFormat(CreateDateTime(FORM.year, FORM.month, FORM.day,
FORM.hour, FORM.minute, FORM.second))#
#DateFormat(CreateDate
(FORM.year, FORM.month, FORM.day), "mmm-dd-yyyy")#
307
th
century

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Coldfusion 4.5

Table of Contents