Changing date result automatically

Changing date result automatically

am 06.05.2010 18:44:37 von Weydson Lima

--001636025ff0ad30770485efa94a
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Is there any way to format all dates generated by a MySQL query as US
format? What I want to do is having a generic way to use the DATE_FORMAT
function on all my date fields, instead of having to enter them manually.
Thank you

---
Weydson Lima
weyseal@gmail.com
http://bluetoothmono.weydson.com

--001636025ff0ad30770485efa94a--

Re: Changing date result automatically

am 06.05.2010 23:00:57 von Weydson Lima

--00c09f8e5de775d44c0485f33ee9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I was referring to the function:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functio ns.html#functio=
n_date-format

---
Weydson Lima
weyseal@gmail.com


On Thu, May 6, 2010 at 1:58 PM, Martin Gainty wrote:

> http://lists.mysql.com/commits/60834
>
> date_format system variable is currently an unused system variable
>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=
=E9
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugt=
e
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAt=
es pas le destinataire pr=E9vu, 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, =
nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni.
>
>
>
>
>
>
> > From: weyseal@gmail.com
> > Date: Thu, 6 May 2010 11:44:37 -0500
> > Subject: Changing date result automatically
> > To: mysql@lists.mysql.com
>
> >
> > Hi,
> >
> > Is there any way to format all dates generated by a MySQL query as US
> > format? What I want to do is having a generic way to use the DATE_FORMA=
T
> > function on all my date fields, instead of having to enter them manuall=
y.
> > Thank you
> >
> > ---
> > Weydson Lima
> > weyseal@gmail.com
> > http://bluetoothmono.weydson.com
>
> ------------------------------
> The New Busy is not the old busy. Search, chat and e-mail from your inbox=
.. Get
> started. T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3>
>

--00c09f8e5de775d44c0485f33ee9--

Re: Changing date result automatically

am 07.05.2010 10:08:44 von Johan De Meersman

--001485eaffd86669b70485fc91ed
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dates are not internally stored as a specific region format, they're stored
as seconds since epoch - just a big number.

Output formatting is a presentation layer issue, which you can solve either
in your SQL [select date_format(datefield, 'us format string') from table]
or in your application.

Maybe MySQL looks at the system's locale for default formatting, or there's
a config setting, but I've never looked at that - doing it explicitly
protects you from annoying glitches when you move to another system that
might be configured slightly differently.


On Thu, May 6, 2010 at 11:00 PM, Weydson Lima wrote:

> I was referring to the function:
>
>
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functio ns.html#funct=
ion_date-format
>
> ---
> Weydson Lima
> weyseal@gmail.com
>
>
> On Thu, May 6, 2010 at 1:58 PM, Martin Gainty wrote=
:
>
> > http://lists.mysql.com/commits/60834
> >
> > date_format system variable is currently an unused system variable
> >
> > Martin Gainty
> > ______________________________________________
> > Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidential=
it=E9
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte
> > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachric=
ht
> > dient lediglich dem Austausch von Informationen und entfaltet keine
> > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >
> > Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=
=EAtes pas
> le destinataire pr=E9vu, nous te demandons avec bont=E9 que pour satisfai=
re
> informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e ou la=
copie
> de ceci est interdite. Ce message sert =E0 l'information seulement et n'a=
ura
> pas n'importe quel effet l=E9galement obligatoire. =C9tant donn=E9 que le=
s email
> peuvent facilement =EAtre sujets =E0 la manipulation, nous ne pouvons acc=
epter
> aucune responsabilit=E9 pour le contenu fourni.
> >
> >
> >
> >
> >
> >
> > > From: weyseal@gmail.com
> > > Date: Thu, 6 May 2010 11:44:37 -0500
> > > Subject: Changing date result automatically
> > > To: mysql@lists.mysql.com
> >
> > >
> > > Hi,
> > >
> > > Is there any way to format all dates generated by a MySQL query as US
> > > format? What I want to do is having a generic way to use the
> DATE_FORMAT
> > > function on all my date fields, instead of having to enter them
> manually.
> > > Thank you
> > >
> > > ---
> > > Weydson Lima
> > > weyseal@gmail.com
> > > http://bluetoothmono.weydson.com
> >
> > ------------------------------
> > The New Busy is not the old busy. Search, chat and e-mail from your
> inbox. Get
> > started.<
> http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL=
:ON:WL:en-US:WM_HMP:042010_3
> >
> >
>



--=20
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--001485eaffd86669b70485fc91ed--

Re: Re: Changing date result automatically

am 07.05.2010 17:47:58 von Weydson Lima

--001485f85e64c43596048602fb20
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Content-Transfer-Encoding: base64

VGhhbmsgeW91IGZvciB5b3VyIGV4cGxhbmF0aW9uLiBJIHdhcyBqdXN0IGN1 cmlvdXMgaWYgdGhl
cmUgd2FzIGFuICJlYXN5IiAgDQp3YXkgdG8gZm9ybWF0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pbWENCg0KDQo+ID4gPiB3ZXlzZWFsQGdtYWlsLmNvbQ0KDQoN Cj4gPiA+IGh0dHA6
Ly9ibHVldG9vdGhtb25vLndleWRzb24uY29tDQoNCg0KPiA+DQoNCg0KDQoN Cj4gPiAtLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCg0KDQo+ID4gVGhlIE5ldyBCdXN5 IGlzIG5vdCB0aGUg
b2xkIGJ1c3kuIFNlYXJjaCwgY2hhdCBhbmQgZS1tYWlsIGZyb20geW91ciAg DQo+IGluYm94LiBH
ZXQNCg0KDQo+ID4gIA0KPiBzdGFydGVkLmh0dHA6Ly93d3cud2luZG93c2xp dmUuY29tL2NhbXBh
aWduL3RoZW5ld2J1c3k/b2NpZD1QSUQyODMyNjo6VDpXTE1UQUdMOk9OOldM OmVuLVVTOldNX0hN
UDowNDIwMTBfMz4NCg0KDQoNCg0KPiA+DQoNCg0KDQoNCg0KPiAtLQ0KPiBC aWVyIG1ldCBncmVu
YWR5bg0KPiBJcyBhbHMgbW9zdGVyZCBieSBkZW4gd3luDQo+IFN5IGRpZSd0 IGRyaW5rdCwgaXMg
ZWVuZSBrd2V6ZWwNCj4gSHkgZGllJ3QgZHJpbmt0LCBpcyByYXMgZWVuIGV6 ZWwNCg0KDQoNCg==
--001485f85e64c43596048602fb20--

Re: Changing date result automatically

am 07.05.2010 18:05:20 von Michael Dykman

You build pretty much any format you desire out of those speifiers. ie:

select date_format(now(),'%m/%c/%Y');

- md

On Thu, May 6, 2010 at 5:00 PM, Weydson Lima wrote:
> I was referring to the function:
>
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functio ns.html#funct=
ion_date-format
>
> ---
> Weydson Lima
> weyseal@gmail.com
>
>
> On Thu, May 6, 2010 at 1:58 PM, Martin Gainty wrote=
:
>
>> =A0http://lists.mysql.com/commits/60834
>>
>> date_format system variable is currently an unused system variable
>>
>> Martin Gainty
>> ______________________________________________
>> Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentiali=
t=E9
>>
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefug=
te
>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachrich=
t
>> dient lediglich dem Austausch von Informationen und entfaltet keine
>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>>
>> Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EA=
tes pas le destinataire pr=E9vu, nous te demandons avec bont=E9 que pour sa=
tisfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9=
e ou la copie de ceci est interdite. Ce message sert =E0 l'information seul=
ement et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9tant =
donn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulation,=
nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni.
>>
>>
>>
>>
>>
>>
>> > From: weyseal@gmail.com
>> > Date: Thu, 6 May 2010 11:44:37 -0500
>> > Subject: Changing date result automatically
>> > To: mysql@lists.mysql.com
>>
>> >
>> > Hi,
>> >
>> > Is there any way to format all dates generated by a MySQL query as US
>> > format? What I want to do is having a generic way to use the DATE_FORM=
AT
>> > function on all my date fields, instead of having to enter them manual=
ly.
>> > Thank you
>> >
>> > ---
>> > Weydson Lima
>> > weyseal@gmail.com
>> > http://bluetoothmono.weydson.com
>>
>> ------------------------------
>> The New Busy is not the old busy. Search, chat and e-mail from your inbo=
x. Get
>> started. :T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3>
>>
>



--=20
- michael dykman
- mdykman@gmail.com

May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg