392
CFML Language Reference
IsDate
Returns TRUE if string can be converted to a date/time value; otherwise, FALSE. Note
that ColdFusion converts the Boolean return value to its string equivalent, "Yes" and
"No."
See also
ParseDateTime
,
CreateDateTime
, and
IsNumericDate
.
Syntax
IsDate
(
string)
string
Any string value.
Usage
Years from 0 to 29 are interpreted as 21
st
century values. Years 30 to 99 are interpreted
as 20
th
century values.
Examples
<!--- This example shows the use of IsDate --->
<HTML>
<HEAD>
<TITLE>
IsDate Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>IsDate Example</H3>
<CFIF IsDefined("FORM.theTestValue")>
<CFIF IsDate(FORM.theTestValue)>
<H3>The string <CFOUTPUT>#DE(FORM.theTestValue)#</CFOUTPUT>
is a valid date</H3>
<CFELSE>
<H3>The string <CFOUTPUT>#DE(FORM.theTestValue)#</CFOUTPUT>
is not a valid date</H3>
</CFIF>
</CFIF>
<FORM ACTION="isDate.cfm" METHOD="POST">
<P>Enter a string, 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>
</BODY>
</HTML>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...