Hi all,

Strange one this, it has me totally perplexed on this Friday morning.

I have several sites which have events pages. The site admin can upload
details of new events, including their dates. This all worked fine until
yesterday, when two of them started acting strangely, like so:

User inputs date: 26/05/01
Date as shown in Access2000: 01/05/26

For some reason it seems to be swapping around the day and year. The date
field is a short date.

This is the code for uploading the date:

<cfif IsDefined("Form.festdate")>

        <cfset festdate = #CreateODBCDate(Form.festdate)#>

</cfif>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<cfquery name="addfest" datasource="#datasourcename#">
INSERT INTO tblfestticks (production, festdate, notes)
VALUES (#Form.production#, #festdate#, '#Form.notes#');
</cfquery>

So, I tried changing the date line to this:

<cfset festdate = #CreateODBCDate(#DateFormat("#Form.festdate#",
"dd/mm/yy")#)#>

and the date 26/05/01 became 05/01/26!!

Now I'm really confused, and whilst I'm sure one of you guys will take one
look at this and sort it out, I am completely stumped.

Regards,

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