List:General Discussion« Previous MessageNext Message »
From:Michael Dykman Date:May 22 2009 6:15pm
Subject:Re: Date Time
View as plain text  
On Fri, May 22, 2009 at 12:42 PM, John Meyer <john.l.meyer@stripped> wrote:
> Janek Bogucki wrote:
>> Hi John,
>> 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@stripped

 - All models are wrong.  Some models are useful.
Date TimeJohn Meyer21 May
  • RE: Date TimeMartin Gainty22 May
  • Re: Date TimeJanek Bogucki22 May
    • Re: Date TimeJohn Meyer22 May
      • RE: Date TimeMartin Gainty22 May
    • Re: Date TimeJohn Meyer22 May
      • Re: Date TimeMichael Dykman22 May