and to follow on from Kym's thoughts... it's worth working out exactly where you convert your date *string* from a form/input to your dateTime *object* as far as the archetecture of your site
for me, it's part of the server-side form validation routines (ie: as soon as I can**). from then on it can be guarenteed that a date will always be a correct dateTime object and can never get confused (because it's no longer a string). conversly, it stays as a dateTime object until needed to be displayed. ** using Kym's suggestion of <cfset payment_from_date = CreateDate(year, month, day)> and lots of getToken stuff that is buried in helper functions. just a thought barry.b On 1/29/07, Kym Kovan <[EMAIL PROTECTED]> wrote: > > 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
