Createodbcdatetime - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

CreateODBCDateTime

Description
Creates an ODBC date-time object.
Returns
A date/time object, in ODBC timestamp format.
Category
Date and time functions
Function syntax
CreateODBCDateTime(date)
See also
CreateDateTime, CreateODBCDate, CreateODBCTime,
Parameters
Parameter
date
Usage
When passing a date/time value as a string, you must enclose it in quotation marks. Otherwise, it
is interpreted as a number representation of a date/time object.
Example
<!--- This example shows how to use CreateDate, CreateDateTime, CreateODBCDate
and CreateODBCDateTime --->
<h3>CreateODBCDateTime Example</h3>
<cfif IsDefined("form.year")>
Your date value, generated using 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:
#DateFormat(CreateDateTime(form.year,form.month,form.day,
form.hour,form.minute,form.second))#
<li>Formatted with CreateODBCDate and DateFormat:
#DateFormat(CreateODBCDate(yourDate), "mmmm d, yyyy")#
<li>Formatted with CreateODBCDateTime and DateFormat:
#DateFormat(CreateODBCDateTime(yourDate), "d/m/yy")#
</ul>
</cfoutput>
</cfif>
432
Chapter 3: ColdFusion Functions
Description
Date/time object in the range 100 AD–9999 AD.
Now

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents