<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CREATEODBCDATE</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CREATEODBCDATE</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Creates an ODBC date object.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
A date object, in normalized ODBC date format.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Date and time functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>CreateODBCDate(date)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
CreateDate, CreateODBCDateTime
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
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 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 = &quot;integer&quot; and range = &quot;1,12&quot;. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;CreateODBCDate Example&lt;/h3&gt;
&lt;CFIF IsDefined(&quot;form.year&quot;)&gt;
&lt;p&gt;Your date value, generated with CreateDateTime:
&lt;CFSET yourDate = CreateDateTime(form.year, form.month, form.day, form.hour,
form.minute, form.second)&gt;
&lt;cfoutput&gt;
&lt;ul&gt;
   &lt;li&gt;Formatted with CreateDate: #CreateDate(form.year, form.month, form.day)#
   &lt;li&gt;Formatted with CreateDateTime: 
      #CreateDateTime(form.year, form.month, form.day, form.hour, form.minute,
form.second)#
   &lt;li&gt;Formatted with CreateODBCDate: #CreateODBCDate(yourDate)#
   &lt;li&gt;Formatted with CreateODBCDateTime: #CreateODBCDateTime(yourDate)#
&lt;/ul&gt;
&lt;p&gt;The same value can be formatted with DateFormat:
&lt;ul&gt;
   &lt;li&gt;Formatted with CreateDate and DateFormat: 
      #DateFormat(CreateDate(form.year,form.month, form.day), &quot;mmm-dd-yyyy&quot;)#
   &lt;li&gt;Formatted with CreateDateTime and DateFormat: 
      #DateFormat(CreateDateTime(form.year, form.month, form.day, form.hour,
form.minute, form.second))#
   &lt;li&gt;Formatted with CreateODBCDate and DateFormat: 
      #DateFormat(CreateODBCDate(yourDate), &quot;mmmm d, yyyy&quot;)#
   &lt;li&gt;Formatted with CreateODBCDateTime and DateFormat: 
      #DateFormat(CreateODBCDateTime(yourDate), &quot;d/m/yy&quot;)#
&lt;/ul&gt;
&lt;/cfoutput&gt;
&lt;/CFIF&gt;
&lt;CFFORM ACTION=&quot;createodbcdate.cfm&quot; METHOD=&quot;POST&quot;&gt;
&lt;p&gt;Enter the year, month and day, as integers:
&lt;PRE&gt;
Year      &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;year&quot; VALUE=&quot;1998&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
Month      &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;month&quot; VALUE=&quot;6&quot; RANGE=&quot;1,12&quot; 
      MESSAGE=&quot;Please enter a month (1-12)&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
Day          &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;day&quot; VALUE=&quot;8&quot; RANGE=&quot;1,31&quot; 
      MESSAGE=&quot;Please enter a day of the month (1-31)&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
Hour      &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;hour&quot; VALUE=&quot;16&quot; RANGE=&quot;0,23&quot; 
      MESSAGE=&quot;You must enter an hour (0-23)&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
Minute      &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;minute&quot; VALUE=&quot;12&quot; RANGE=&quot;0,59&quot; 
      MESSAGE=&quot;You must enter a minute value (0-59)&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
Second      &lt;CFINPUT TYPE=&quot;Text&quot; NAME=&quot;second&quot; VALUE=&quot;0&quot; RANGE=&quot;0,59&quot; 
      MESSAGE=&quot;You must enter a value for seconds (0-59)&quot; VALIDATE=&quot;integer&quot; 
      REQUIRED=&quot;Yes&quot;&gt;
&lt;/PRE&gt;
&lt;p&gt;&lt;INPUT TYPE=&quot;Submit&quot; NAME=&quot;&quot;&gt; &lt;INPUT TYPE=&quot;RESET&quot;&gt;
&lt;/cfform&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="DATE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DATE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


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

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
