Whatever message this page gives is out now! Go check it out!

CreateODBCDate

Last update:
May 18, 2026

Description

Creates an ODBC date object.

Returns

A date object, in normalized ODBC date format.

Category

Function syntax

CreateODBCDate(date)

See also

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

<cfscript>
    year = 2018;
    month = 11;
    day = 02;
    hour = 1;
    minute= 09;
    second= 46;
    myDate=CreateDateTime(year,month,day,hour,minute,second)
    format=CreateODBCDate(myDate)
    writeOutput("Date format is : " & format);
</cfscript>
Output
Date format is : {d '2018-11-02'}

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page