Hello Claude,

you wrote:
> hi al
>  
> I have the following date that I need to specify in my code   <cfset 
> payment_from_date="10-01-07">
> however I cannot seem to display it in correct date format using the 
> dateformat function it keeps returning 1-oct-07 when I am using 
> dateformat(payment_date, dd-mmm-yy)

Your problem is probably not the display formatting but the actual date 
itself.

Your cfset should be:
<cfset payment_from_date = CreateDate(year, month, day)>
then the date is a proper date object in CF and then dateformat will 
work properly.

> I look forward to your advice
>  
> seem to find date display / manipulation a real pain in the butt to 
> get the correct format

If you will forgive me I will use this as an excuse for one of my 
favourite rants, one I can get quite hot under the collar about :-)

Almost everyone and his dog treats dates wrongly in CF and often in 
databases as well. They see a nice date string in Enterprise Manager or 
Access such as "10-01-07" and think it is a string. It is not, that tool 
is formatting it nicely for us dumb humans as hiding the fact that it is 
a a date object. A date in a database should always be a date datatype, 
not a string. If it is and you always treat dates as proper date objects 
in CF then you will not have these date format issues.


HTH

Kym K


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to