Description

Evaluates whether a real number is a valid representation of a date (date/time object).

Returns

True, if the parameter represents a valid date/time object; False, otherwise.

Category

Syntax

IsNumericDate(number)

See also

Parameters

Parameter

Description

number

A real number

Usage

ColdFusion, by default, evaluates any input parameter and attempts to convert it to a real number before it passes the parameter to the IsNumericDate function. As a result, parameter values such as 12/12/03 and {ts '2003-01-14 10:04:13'} return True, because ColdFusion converts valid date string formats to date/time objects, which are real numbers.

Example

<cfscript>
    date = IsNumericDate(now());
    writeOutput("Is date is represented in a valid date format: " & date & "<br/>");
</cfscript>

Output

Is date is represented in a valid date format: YES

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