> >> >   I'm not sure what makes a variable "good" in this case, but if you
> >> >   offer more information, perhaps I can offer more information.
> >>
> >>I'm checking the value of a date to make sure it's legal.  (I've had no
> >>end of problems with the date parsing side of CFINPUT so I'm figured I'd
> >>do it myself.)
>
> >   I do worry that you are re-inventing the wheel.  Have you looked at 
>the
> > IsDate or LSIsDate function?
> >   I'm not sure if ColdFusion has a specific way to compare against a 
>given
> > mask, though, but if your intent is to turn it into an ODBC date, the
> > given mask doesn't matter if you use the CreateODBCDate function.
>
>How would CreateODBCDate() know the difference between 02/05/2002 and 
>05/02/2002? ... both are valid dates and both could represent the same two 
>dates, dependant upon who's entering it and whether or not they're in the 
>US...

You need to parse it to a CF Date Time object according to the locale.

<cfif LsIsDate(someDate)>
   <cfset ODBCDate = CreateODBCDate(LsParseDateTime(someDate))>
</cfif>

Cheers,
Mark




______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to