Like the IsDate
function, LSIsDate
returns TRUE if string can be converted to a date/time value in the current locale, FALSE otherwise.
LSIsDate(string)
Parameter |
Description |
---|---|
string |
A string value |
Years less than 100 are interpreted as 20th century dates.
<!--- This example shows LSIsDate ---> <html> <head> <title>LSIsDate Example</title> </head> <body bgcolor = silver> <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" method = "POST"> <P>Select a locale for which you would like to check a date value: <!--- check the current locale for server ---> <cfset serverLocale = GetLocale()> ...