Date Time

Date Time

am 21.05.2009 23:19:16 von John in Pueblo

Is "Thu May 21 03:15:28 +0000 2009" a valid date/time string?

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

RE: Date Time

am 22.05.2009 00:17:08 von Martin Gainty

--_8cef4875-d88f-454a-abaa-5b1fd773cdce_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


mysql> select sysdate() from DUAL=3B
+---------------------+
| sysdate() |
+---------------------+
| 2009-05-21 17:37:13 |
+---------------------+

i would get the proprt format is=20
i could CONVERT_TZ to work
can you get CONVERT_TZ to work ?
Martin Gainty=20
______________________________________________=20
Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=
=E9
=20
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng=
er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter=
leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l=
ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin=
dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w=
ir 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=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=
..
> Date: Thu=2C 21 May 2009 15:19:16 -0600
> From: john.l.meyer@gmail.com
> To: mysql@lists.mysql.com
> Subject: Date Time
>=20
> Is "Thu May 21 03:15:28 +0000 2009" a valid date/time string?
>=20
> --=20
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@hotmail.c=
om
>=20

____________________________________________________________ _____
Hotmail=AE has ever-growing storage! Don=92t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_T AGLM_WL_HM_Tuto=
rial_Storage1_052009=

--_8cef4875-d88f-454a-abaa-5b1fd773cdce_--

Re: Date Time

am 22.05.2009 12:17:33 von Janek Bogucki

Hi John,

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.h tml includes
some information about acceptable literal forms for dates and times.

'Thu May 21 03:15:28 +0000 2009' is not an acceptable literal form but
this is how to parse it APART from the time zone component. I could not
see from the documentation how to specify the time zone component so the
format below IGNORES the time zone.

mysql> create table t(d datetime);

mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000 2009', '%a %b %e %H:%i:%s +0000 %Y'));

mysql> select * from t;
+---------------------+
| d |
+---------------------+
| 2009-05-21 03:15:28 |
+---------------------+
1 row in set (0.01 sec)

On Thu, 2009-05-21 at 15:19 -0600, John Meyer wrote:
> Is "Thu May 21 03:15:28 +0000 2009" a valid date/time string?
>

--
Best Regards,
-Janek Bogucki, CMDEV 5.0.
StudyLink. Helping People Realise Their Potential.
http://studylink.com



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

Re: Date Time

am 22.05.2009 15:14:58 von John in Pueblo

Janek Bogucki wrote:
> Hi John,
>
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.h tml includes
> some information about acceptable literal forms for dates and times.
>
> 'Thu May 21 03:15:28 +0000 2009' is not an acceptable literal form but
> this is how to parse it APART from the time zone component. I could not
> see from the documentation how to specify the time zone component so the
> format below IGNORES the time zone.
>
> mysql> create table t(d datetime);
>
> mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000 2009', '%a %b %e %H:%i:%s +0000 %Y'));
>
>
Thanks. That'll work.

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

RE: Date Time

am 22.05.2009 16:15:40 von Martin Gainty

--_f54212f3-3655-4408-a37f-e0e4031c3037_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


mysql> create table t(d datetime)=3B
Query OK=2C 0 rows affected (0.08 sec)

mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000 2009'=
=2C '%a
%b %e %H:%i:%s +0000 %Y'))=3B
Query OK=2C 1 row affected (0.00 sec)

mysql> select * from t=3B
+---------------------+
| d |
+---------------------+
| 2009-05-21 03:15:28 |
+---------------------+

most of us have contacts in europe who dont use EDT=2CCDT=2CMDT or PDT so=20
i *was hoping* to get confirmation on CONVERT_TZ(date=2Cfrom_tz=2Cto_tz) wo=
rks?

Thanks=2C
Martin Gainty=20
______________________________________________=20
Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=
=E9
=20
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng=
er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter=
leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l=
ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin=
dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w=
ir 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=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=
..




> Date: Fri=2C 22 May 2009 07:14:58 -0600
> From: john.l.meyer@gmail.com
> To: janek.bogucki@studylink.com
> CC: mysql@lists.mysql.com
> Subject: Re: Date Time
>=20
> Janek Bogucki wrote:
> > Hi John=2C
> >
> > http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.h tml include=
s
> > some information about acceptable literal forms for dates and times.
> >
> > 'Thu May 21 03:15:28 +0000 2009' is not an acceptable literal form but
> > this is how to parse it APART from the time zone component. I could not
> > see from the documentation how to specify the time zone component so th=
e
> > format below IGNORES the time zone.
> >
> > mysql> create table t(d datetime)=3B
> >
> > mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000 2=
009'=2C '%a %b %e %H:%i:%s +0000 %Y'))=3B
> >
> > =20
> Thanks. That'll work.
>=20
> --=20
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@hotmail.c=
om
>=20

____________________________________________________________ _____
Hotmail=AE has ever-growing storage! Don=92t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_T AGLM_WL_HM_Tuto=
rial_Storage1_052009=

--_f54212f3-3655-4408-a37f-e0e4031c3037_--

Re: Date Time

am 22.05.2009 18:42:56 von John in Pueblo

Janek Bogucki wrote:
> Hi John,
>
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.h tml includes
> some information about acceptable literal forms for dates and times.
>
> 'Thu May 21 03:15:28 +0000 2009' is not an acceptable literal form but
> this is how to parse it APART from the time zone component. I could not
> see from the documentation how to specify the time zone component so the
> format below IGNORES the time zone.
>
> mysql> create table t(d datetime);
>
> mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000 2009', '%a %b %e %H:%i:%s +0000 %Y'));
>
BTW, how would you work that with offsets that were a different value
(say +0700).

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

Re: Date Time

am 22.05.2009 20:15:59 von Michael Dykman

On Fri, May 22, 2009 at 12:42 PM, John Meyer wrote:
> Janek Bogucki wrote:
>>
>> Hi John,
>>
>> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.h tml includes
>> some information about acceptable literal forms for dates and times.
>>
>> 'Thu May 21 03:15:28 +0000 2009' is not an acceptable literal form but
>> this is how to parse it APART from the time zone component. I could not
>> see from the documentation how to specify the time zone component so the
>> format below IGNORES the time zone.
>>
>> mysql> create table t(d datetime);
>>
>> mysql> insert into t(d) values(str_to_date('Thu May 21 03:15:28 +0000
>> 2009', '%a %b %e %H:%i:%s +0000 %Y'));
>>
>
> BTW, how would you work that with offsets that were a different value (say
> +0700).

I don't think you do. You would have to get your application to parse
out the date into something that MySQL can negotiate. The only reason
this works at all in your case is because you happen to have +0000
which we can safely ignore.


--
- michael dykman
- mdykman@gmail.com

- All models are wrong. Some models are useful.

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