Hi Everyone, And thanks to you all for replying... Upon reflection my initial email wasn't very good. I have postgresql and mysql installed. Using postgresql;
(ls)dateformat(DATE,"YYYY-MM-DD") both correctly insert a eurodate into the database. I am trying to do something with mysql on the same machine - and so assumed it was a mysql issue as opposed to anything else. SetLocale / lsdateformat... does indeed correct the issue for me - but I still wonder why it is not needed for postgresql backend and yet it is required for mysql? Anyway.... I can successfully insert dates now... so I suppose that's the important thing! Gavin. On Jul 20, 3:05 pm, Zac Spitzer <[email protected]> wrote: > I always try and use 3-mar-2011 style date formats as it avoids > any of the month issues, but using the locale and Ls* functions > is the most robust approach > > > > > > > > > > On Wed, Jul 20, 2011 at 1:49 PM, Dale Fraser <[email protected]> wrote: > > Do this > > > #createodbcdatetime(createDate(mid(form.datelisted, 7, 4), > > mid(form.datelisted, 4, 2), mid(form.datelisted, 1, 2))#< > > > Dale > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On > > Behalf > > Of Gavin Baumanis > > Sent: Wednesday, 20 July 2011 12:05 AM > > To: cfaussie > > Subject: [cfaussie] MySQL - date insertion issues. > > > Hi Everyone, > > > I have the following code; > > > form.date : #form.datelisted#<br /> > > LSDATEFORMAT : #lsdateformat(form.datelisted, 'YYYY-MM-DD')#<br /> > > DATEFORMAT : #dateformat(form.datelisted, 'YYYY-MM-DD')#<br /> > > CREATEODBCDATE : #createodbcdate(form.datelisted)#<br /> CREATEODBCDATETIME > > : #createodbcdatetime(form.datelisted)#<br /> > > > Which outputs the following; > > > form.date : 01/03/2011 > > LSDATEFORMAT : 2011-01-03 > > DATEFORMAT : 2011-01-03 > > CREATEODBCDATE : {d '2011-01-03'} > > CREATEODBCDATETIME : {ts '2011-01-03 00:00:00'} > > > My question is why are my month and day parts of my date being transposed? > > How do I stop it from being so? > > > The date that should be inserted into the database is the 1st of March, not > > 3rd January. > > > As always - Thanks! > > > Gavin. > > > -- > > 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. > > > -- > > 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. > > -- > Zac Spitzer > Solution Architect / Director > Ennoble Consultancy > Australiahttp://www.ennoble.com.auhttp://zacster.blogspot.com > +61 405 847 168 -- 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.
