LSIsDate

Description

Like the IsDate function, LSIsDate returns TRUE if string can be converted to a date/time value in the current locale, FALSE otherwise.

Category

International functions

Syntax

LSIsDate(string) 

Parameters

Parameter
Description
string
A string value

Usage

Years less than 100 are interpreted as 20th century dates.

Example

<!--- 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()>
...