Try the following instead:

<cfset
deldate=CreateODBCDate(LSParseDateTime("#form.day#/#form.month#/#form.year#"
))>

btw, make sure your locale is set to a non-US locale otherwise your dd/mm/yy
will be interpreted as mm/dd/yy (unless the date is beyond the 12th of the
month).

Steve

> -----Original Message-----
> From: Will Swain [mailto:[EMAIL PROTECTED]]
> Sent: 24 April 2001 12:10
> To: CF-Talk
> Subject: data nonsense
>
>
> Hi all,
>
> Having this problem with dates which I mentioned before, but no-one seemed
> to be able to help.
>
> Basically, I have an order form , which has a day, month and year
> drop down
> menus which are combined for the date. These fields are put
> together on the
> next page to make a date, which I then ODBC date format to ensure its ok.
> Here is the code:
>
> The date entered is 28th November 2001
>
> the fields passed over are 28 11 01
>
> <cfset intdate = "#form.day#/#form.month#/#form.year#">
>
> intdate now equals 28/11/01
>
> <cfset formatdate = #DateFormat(intdate, "dd/mm/yy")#>
>
> formatdate now equals 01/11/28
>
> <cfset deldate = #CreateODBCDate(formatdate)#>
>
> deldate now equals {d '2028-01-11'}.
>
> Now I just cannot see why this is happening to the date.However,
> it doesn't
> always happen. Look at this:
>
> The date entered is 7th November 2001
>
> the fields passed over are 7 11 01
>
> intdate now equals 07/11/01
>
> formatdate now equals 11/07/01
>
> deldate now equals {d '2001-11-07'}
>
> I have done this kind of thing loads of times, and never seen this problem
> before. Futhermore, it has just suddenly started happening.
> Anyone have any
> ideas as to what's going on. FYI, the db is Access2000 and the
> field type is
> short date.
>
> TIA
>
> Will Swain
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to