Create() chopping off time zone

I’m doing:

item = Item.create(:added=>‘Thu, 26 Jan 2006 21:18:59 GMT’, …)

But it gets saved in the (PostgreSQL) database as:

2006-01-26 21:18:59-07

Looking at the log, Rails is inserting ‘added’ as ‘2006-01-26 21:18:59’.
How can I get it to preserve the time zone? If the original timestamp
gets passed to PostgreSQL as is, it’ll handle the conversion.

thanks
csn

Bug:
http://dev.rubyonrails.org/ticket/2244

Workaround:
item = Item.create(:added=>Time.parse(‘Thu, 26 Jan 2006 21:18:59
GMT’).localtime, …)

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