Description

Creates a date/time object.

Returns

A date/time value.

Category

Date and time functions

Function syntax

CreateDate(year, month, day)

See also

CreateDateTimeCreateODBCDateTimeEvaluation and type conversion issues in Data type conversion in the Developing ColdFusion Applications

Parameters

Parameter

Description

year

Integer in the range 0-9999. Integers in the range 0-29 are converted to 2000-2029. Integers in the range 30-99 are converted to 1930-1999. You cannot specify dates before AD 100.

month

Integer in the range 1 (January)-12 (December)

day

Integer in the range 1-31

Usage

CreateDate is a subset of CreateDateTime.The time in the returned object is set to 00:00:00.

Example

<cfscript>
    year = 2018;
    month = 11;
    day = 02;
    myDate=CreateDate(year,month,day)
    writeOutput("The date is: " & myDate);
</cfscript>

Output

The date is: {ts '2018-11-02 00:00:00'}

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