Barry L Beattie wrote:

Hi all

I've been bitten with CF's rejection of the ISO date format with LSDateFormat and 
general grief with non-US dates (esp with dd/mm/yyyy). The idea is simply to pass a 
date from a form to a cfqueryparam in ISO format without grief. I'm not winning.

"invalid date format" LSDateFormat("1996/01/03","yyyy/mm/dd")

Apart from tearing the date apart and re-assembling it or using "mmm" for months, is there anything else that consistantly works?

Kola is spot on the mark with his second paragraph. In CF date/time objects use the ODBC Date time format (http://www.schemamania.org/jkl/booksonline/SQLBOL70/html/8_con_03_13.htm)

I've no idea why it doesn't use ISO/UTC format dates (http://www.w3.org/TR/NOTE-datetime), possibly because ISO8601 was only just coming into being when CF was already in version 3, but thats the reason why you're having problems. You need to convert your date into an ODBC DateTime format and pass that in as your first parameter in the LSDateFormat.

However, given that you are passing the date to cfqueryparam, you need only ensure that the data is in a format that is valid for your dbms. This means you might get away with passing your date straight into cfqueryparam.

Regards

Stephen


-- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
     *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
          *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]



Reply via email to