For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
CFML Reference / 

CreateODBCDate

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

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

Description

date

Date or date/time object in the range 100 AD-9999 AD.

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), Adobe recommends that you parse entered dates with the DateFormat function, using the mm-dd-yyyy mask, into three elements. Ensure that values are within appropriate ranges; for example, to validate a month value, use the attributes validate = "integer" and range = "1,12".

Example

<h3>CreateODBCDate Example</h3> 
<cfif IsDefined("form.year")> 
<p>Your date value, generated with CreateDateTime:</p> 
<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> 
<li>Formatted with CreateDateTime: 
#CreateDateTime(form.year, form.month, form.day, form.hour, form.minute, 
form.second)#</li> 
<li>Formatted with CreateODBCDate: #CreateODBCDate(yourDate)#</li> 
<li>Formatted with CreateODBCDateTime: #CreateODBCDateTime(yourDate)#</li> 
</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> 
<li>Formatted with CreateDateTime and DateFormat: 
#DateFormat(CreateDateTime(form.year, form.month, form.day, form.hour, 
form.minute, form.second))#</li> 
<li>Formatted with CreateODBCDate and DateFormat: 
#DateFormat(CreateODBCDate(yourDate), "mmmm d, yyyy")#</li> 
<li>Formatted with CreateODBCDateTime and DateFormat: 
#DateFormat(CreateODBCDateTime(yourDate), "d/m/yy")#</li> 
</ul> 
</cfoutput> 
</cfif> 
<cfform action="createodbcdate.cfm" method="POST"> 
<p>Enter the year, month and day, as integers: 
<pre> 
Year <cfinput type="Text" name="year" value="1998" validate="integer" 
required="Yes"> 
Month <cfinput type="Text" name="month" value="6" range="1,12" 
message="Please enter a month (1-12)" validate="integer" 
required="Yes"> 
Day <cfinput type="Text" name="day" value="8" range="1,31" 
message="Please enter a day of the month (1-31)" validate="integer" 
required="Yes"> 
Hour <cfinput type="Text" NAME="hour" value="16" range="0,23" 
message="You must enter an hour (0-23)" validate="integer" 
required="Yes"> 
Minute <cfinput type="Text" name="minute" value="12" range="0,59" 
message="You must enter a minute value (0-59)" validate="integer" 
required="Yes"> 
Second <cfinput type="Text" name="second" value="0" range="0,59" 
message="You must enter a value for seconds (0-59)" validate="integer" 
required="Yes"> 
</pre> 
<p><input type="Submit" name=""> <input type="Reset"> 
</cfform>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices