Date Conversion

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

Hi,

Please, try it:

DateTime.parse(“2010-03-31T07:47:46 -500”).to_s

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs