Isnumericdate - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

IsNumericDate

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; otherwise, False.
Category
Date and time
functions,
Function syntax
IsNumericDate(number)
See also
IsDate,
ParseDateTime
Parameters
Parameter
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
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
<h3>IsNumericDate Example</h3>
<cfif IsDefined("form.theTestValue")>
<!--- test if the value represents a number or a pre-formatted Date value --->
<cfif IsNumeric(form.theTestValue) or IsDate(form.theTestValue)>
<!--- if this value is a numericDate value, then pass --->
<cfif IsNumericDate(form.theTestValue)>
<h3>The string <cfoutput>#DE(form.theTestValue)#</cfoutput> can be
converted to a valid numeric date</h3>
<cfelse>
<h3>The string <cfoutput>#DE(form.theTestValue)#</cfoutput> can not be
converted to a valid numeric date</h3>
</cfif>
<cfelse>
<h3>The string <cfoutput>#DE(form.theTestValue)#</cfoutput> is not a valid
numeric date</h3>
</cfif>
</cfif>
<form action="#cgi.script_name#" method="POST">
<p>Enter a value, and discover if it can be evaluated to a date value.
<p>
<input type="Text" name="TheTestValue" value="<CFOUTPUT>#Now()#</CFOUTPUT>">
<input type="Submit" value="Is it a Date?" name="">
</form>
540
Chapter 3: ColdFusion Functions
Decision functions
Description
A real number
IsNumericDate
function. As a result, parameter values such

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents