Hi,
Please, try it:
DateTime.parse("2010-03-31T07:47:46 -500").to_s
On 1 апр, 01:22, Sav <savar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Can someone help me format the following date into a db-friendly
> datetime value?
>
> Here is the date I get from an XML file...
> xmldate = "2010-03-31T07:47:46 -500"
>
> But xmldate.to_datetime isn''t handling the timezone...
> 2010-03-31T07:47:46+00:00
>
> Any ideas how I get to this?...
> 2010-03-31T07:47:46-05:00
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.