From: Martin Gainty Date: April 9 2010 5:48pm Subject: RE: DATE_FORMAT parameter question List-Archive: http://lists.mysql.com/mysql/221195 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_5d1547f9-d15d-4407-b73f-77d0e354cde4_" --_5d1547f9-d15d-4407-b73f-77d0e354cde4_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Carsten =20 thanks for providing mysql support at 846pm kobenhavn time (on a fridag no = less) I will DEFINITELY check this out =20 Takk! Martin Gainty=20 ______________________________________________=20 Note de d=E9ni et de confidentialit=E9 Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAtes= pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que pour sat= isfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e= ou la copie de ceci est interdite. Ce message sert =E0 l'information seule= ment et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9tant d= onn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulation= =2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni= . =20 > Date: Fri=2C 9 Apr 2010 19:02:33 +0200 > From: carsten@stripped > To: mgainty@stripped > CC: mysql@stripped > Subject: Re: DATE_FORMAT parameter question >=20 > If you'll excuse the shameless plug: I once created a tool to help find=20 > the exact parameters to use for PHPs date() and MySQLs DATE_FORMAT().=20 > Please see >=20 > http://bitbybit.dk/php/date_format/ >=20 > (Yes=2C it looks horrible. But it works) >=20 > / Carsten >=20 > Martin Gainty skrev: > > Good Afternoon All > >=20 > >=20 > > following the documentation available at > >=20 > > http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html > >=20 > > i wish to select a date using DD-MON-YY format but my format of '%y-%b-= %d' appears to be incorrect > >=20 > >=20 > >=20 > > mysql> select DATE_FORMAT('11-10-09'=2C'%y-%b-%d') from DUAL=3B > > +------------------------------------+ > > | DATE_FORMAT('11-10-09'=2C'%y-%b-%d') | > > +------------------------------------+ > > | 11-Oct-09 | > > +------------------------------------+ > > 1 row in set (0.00 sec) > >=20 > >=20 > >=20 > > mysql> show variables like "%VERSION%"=3B > > +-------------------------+------------------------------+ > > | Variable_name | Value | > > +-------------------------+------------------------------+ > > | protocol_version | 10 | > > | version | 5.1.25-rc-community-log | > > | version_comment | MySQL Community Server (GPL) | > > | version_compile_machine | ia32 | > > | version_compile_os | Win32 | > > +-------------------------+------------------------------+ > > 5 rows in set (0.00 sec) > >=20 > >=20 > > it seems when i follow the documentation which states %d is used for da= y and %y is year i see: > > mysql> select DATE_FORMAT('11-10-09'=2C'%d-%b-%y') from DUAL=3B > > +------------------------------------+ > > | DATE_FORMAT('11-10-09'=2C'%d-%b-%y') | > > +------------------------------------+ > > | 09-Oct-11 | > >=20 > >=20 > >=20 > > but if i switch %y and %d in date_format I get the correct result e.g. > >=20 > > mysql> select DATE_FORMAT('11-10-09'=2C'%y-%b-%d') from DUAL=3B > > +------------------------------------+ > > | DATE_FORMAT('11-10-09'=2C'%y-%b-%d') | > > +------------------------------------+ > > | 11-Oct-09 | > > +------------------------------------+ > > 1 row in set (0.00 sec) > >=20 > >=20 > > any ideas on what I am doing wrong with format string to produce desire= d DD-MON-YY format? > >=20 > >=20 > >=20 > > Many Thanks=2C > > Martin Gainty=20 > > ______________________________________________=20 > > Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidential= it=E9 > >=20 > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empf= aenger sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte We= iterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht die= nt lediglich dem Austausch von Informationen und entfaltet keine rechtliche= Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koenn= en wir keine Haftung fuer den Inhalt uebernehmen. > >=20 > > Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'= =EAtes pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que po= ur satisfaire informez l'exp=E9diteur. N'importe quelle diffusion non autor= is=E9e ou la copie de ceci est interdite. Ce message sert =E0 l'information= seulement et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9= tant donn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipula= tion=2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fo= urni.. > >=20 > >=20 > >=20 > > _________________________________________________________________ > > Hotmail is redefining busy with tools for the New Busy. Get more from y= our inbox. > > http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID28326::T:WLMTA= GL:ON:WL:en-US:WM_HMP:042010_2 > >=20 > > !DSPAM:451=2C4bbf4251775757489286036! > >=20 >=20 > --=20 > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@stripped >=20 =20 _________________________________________________________________ The New Busy is not the too busy. Combine all your e-mail accounts with Hot= mail. http://www.windowslive.com/campaign/thenewbusy?tile=3Dmultiaccount&ocid=3DP= ID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4= --_5d1547f9-d15d-4407-b73f-77d0e354cde4_--