Determines whether a string is a valid representation of a date/time value in the current locale.
True, if the string can be formatted as a date/time value in the current locale; False, otherwise.
Date and time functions, Display and formatting functions, International functions
LSIsDate(string
[,locale
])
CreateDateTime, GetLocale, IsNumericDate, LSDateFormat, ParseDateTime, SetLocale; "Handling data in ColdFusion" in the ColdFusion Developer's Guide
ColdFusion 8: Added the locale parameter.
ColdFusion MX:
Parameter |
Description |
---|---|
string |
A string or a variable that contains one |
locale |
Locale to use instead of the locale of the page when processing the function |
A date/time object is in the range 100 AD-9999 AD.
To set the default display format of date, time, number, and currency values, use the SetLocale function.
<h3>LSIsDate Example</h3> <cfif IsDefined("FORM.locale")> <!--- if locale is defined, set locale to that entry ---> <cfset NewLocale = SetLocale(FORM.locale)> <p>Is the value "<cfoutput>#FORM.myValue#</cFOUTPUT>" a proper date value for <cfoutput>#GetLocale()#</cfoutput>? <p>Answer: <cfoutput>#LSIsDate(FORM.myValue)#</cfoutput> </cfif> <p><form action = "LSIsDate.cfm"> <p>Select a locale for which you would like to check a date value: <!--- check the current locale for server ---> <cfset serverLocale = GetLocale()>