His problem was that when he takes that date and inserts it into SQL it goes in as 2010-06-10, but if the month was past the 12th then it goes in incorrectly, i.e. if he does 2010-12-30 he gets December 30 (correct), if he goes 2010-04-07 he gets July 4 (wrong).

Personally, I still reckon it's SQL Server doing something odd. Can you try another SQL login/username and see what happens then? or do you only have one login?



On 9/06/2010 11:00 AM, Steve Onnis wrote:
But thats correct isnt it? October is the 10th month


From: Mike Kear [mailto:afpwebwo...@gmail.com]
Sent: Wednesday, 9 June 2010 10:30 AM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] Re: Odd date behaviour - CF9/SQLServer2005

Believe it or not, I'm still worrying away at this date issue.    I dont understand ColdFusion's insistence that we have to use American dates.   (This is CF9 Enterprise by the way)

I create a date object,  using the following: 

createdate("2010","10","06")   which is supposed to be year, month, day in that order.    Then when i output the date in the next line it shows that date as 06/Oct/2010

It doesn't seem to make any difference whether i set a locale or not.     It's nothing to do with dateformat,  the problem here is that I'm creating a date using year-month-day and it's understanding it as year-day-month.    HUH??

Here is the actual code: 
<cfset testdate = createdate("2010","10","06") />
<cfoutput>
<p>test date is  #testdate# : #dateformat(testdate, "dd/mmm/yyyy")# </p>
</cfoutput>

The result i get is this: 
test date is {ts '2010-10-06 00:00:00'} : 06/Oct/2010

Can someone else please run this code on their CF9 and see if they get the same result?   That way i can know if this is being caused by something in the environment here.


Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month





On Tue, Jun 8, 2010 at 4:44 PM, Scott Thornton <scott.thorn...@hnehealth.nsw.gov.au> wrote:
IMO, Set Langauge seems a bit... obtuse?

SET LANGUAGE DMY seems more appropriate, especially if you are giong to enter it into every sproc.

cheers,

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Reply via email to