IsDate() - check a string, is it date object or not
IsDate.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IsDate function example: how to check string, is it date object or not</title>
</head>
<body>
<h2 style="color:hotpink">IsDate Function Example</h2>
<cfset ToDay=DateFormat(Now())>
<cfset Myname="Jones">
<cfoutput>
<b>
ToDay: #ToDay#
<br />
MyName: #MyName#
<br /><br />
</b>
</cfoutput>
<table style="color:LightGreen; background:Green;" border="1" bordercolor="DarkGreen">
<tr>
<td style="font-weight:bold">IsDate</td>
<td style="font-weight:bold">Output</td>
</tr>
<tr>
<td>#IsDate(ToDay)#</td>
<td><cfoutput>#IsDate(ToDay)#</cfoutput></td>
</tr>
<tr>
<td>#IsDate(MyName)#</td>
<td><cfoutput>#IsDate(MyName)#</cfoutput></td>
</tr>
</table>
</body>
</html>
- CreateDate() - create a date object
- CreateTimeSpan() - create a time span
- DateAdd() - add year, quarter, month, week, day, hour, minute, second to a date
- DateCompare() - compare two date time object
- DateDiff() - get difference between two date time object
- DateFormat() - format a date value using U.S. date format
- Month() - get the month value from a date time object