do you have a return type set on the function of the cfc ?

  _____  

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


Well i had to suck that back again and wished i could have completely
obliterated my previous email.   I had a mistake in the code i posted on my
example earlier.    But i have just found the exact scenario happening.  

Inside my CFCs,  i think American dates are always assumed.   I am setting a
date in my bean.   Even if i specifically set it using the code i quoted in
my last email  ( i.e. PosBean.setTransDate( createdate("2010","06","10") )
for 10th June)   if i immediately output the date I get a different result
to what i get if i have it in a regular .cfm file. 

<cfdump var="#lsdateformat(posbean.getTransDate(), 'dd/mmm/yyyy')#" /> 
<cfdump var="#dateformat(posbean.getTransDate(), 'dd/mmm/yyyy')#"  />

This code in a .cfm file outputs two showing 10 June.   If i output from a
.cfc it shows the first as 10 June, and the second as 6 October.

So unless i'm mistaken, I get a different result in a .cfm page than i get
if i output from a cfc.  The trouble is, it's the .cfc that is causing the
problem because its the cfc that creates the insert statement to the
database.

 This is proving to be a particularly elusive problem.  But since we use
dates to select records for a whole host of reports,  it's essential that i
sort it out.


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 Wed, Jun 9, 2010 at 10:33 AM, Dale Fraser <d...@fraser.id.au> wrote:


Its working

 

createDate(year, month, day)

 

2010,10,06 is 6th of October.

 

Regards

Dale Fraser

 

http://dale.fraser.id.au

http://cfmldocs.com <http://cfmldocs.com/> 

http://learncf.com

http://flexcf.com

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of Mike Kear
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 cfaus...@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com
<mailto:cfaussie%2bunsubscr...@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
<mailto:cfaussie%2bunsubscr...@googlegroups.com> .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.





-- 
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


-- 
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.

-- 
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