August 2003
Intermediate to advanced
1140 pages
68h 45m
English
LSIsDate
LSIsDate(date)Functions identically to the IsDate( ) function
within the context of the current locale. Returns
true if date can be
converted to a date/time object in the current locale or
false if it can’t. In ColdFusion
MX, the hyphen is only a valid date delimiter in the Dutch (Standard)
and Portuguese (Standard) locales. Additionally, if you have the Sun
JRE 1.3.1 running in the English (UK) locale, the month and day
portion of a date string must have a leading zero for single-digit
months/days. The following example determines whether the supplied
values are valid date/time objects for each locale:
<cfloop index="locale" list="#Server.Coldfusion.SupportedLocales#">
<cfset SetLocale(locale)>
<cfoutput>
<p><b>#locale#</b><br>
04/15/2002: #LSIsDate('04/15/2002')#<br>
15-04-2002: #LSIsDate('15-04-2002')#<br>
15/04/2002: #LSIsDate('15/04/2002')#<br>
13/13/2002: #LSIsDate('13/13/2002')#<br>
August 15, 2002: #LSIsDate('August 15, 2002')#<br>
15 Apr 2002: #LSIsDate('15 Apr 2002')#<br>
7 p.m.: #LSIsDate('7 p.m.')#<br>
7pm: #LSIsDate('7pm')#<br>
19:00: #LSIsDate('19:00')#<br>
six thirty: #LSIsDate('six thirty')#
</cfoutput>
</cfloop>