User Guide Cancel

CreateODBCDate

 

Description

Creates an ODBC date object.

Returns

A date object, in normalized ODBC date format.

Category

Date and time functions

Function syntax

CreateODBCDate(date)
CreateODBCDate(date)
CreateODBCDate(date)

See also

CreateDateCreateODBCDateTime

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>
<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>
<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'}

Get help faster and easier

New user?