isDate

Determines whether a string or Java object can be converted
to a date/time value.

isDate(Object) → returns boolean

Argument Reference

Object any
Required

A string or variable name

Examples
Sample code invoking the isDate function

To determine whether a string can be converted to a date/time value.

<cfset Date = CreateDate(2012, 12, 12)>
<cfset result = isDate(Date)>
<cfoutput>#result#</cfoutput>

Expected Result: Yes

To determine whether a string can be converted to a date/time value.

<cfset result = isDate("Date")>
<cfoutput>#result#</cfoutput>

Expected Result: No

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub