On Tue, Apr 12, 2011 at 4:40 PM, Stephen H. Gerstacker <
[email protected]> wrote:

> I've been working on the internal app for my company which is well
> over 4 years old.  First commit was using Rails 1.1.6.
>
> I'm now at 2.3.11 and I have a branch of my code that is converted to
> 3.0.6, but I just noticed a problem.  The Rails 3 branch is pushing
> timestamps with time zone manipulation.  I knew that Rails had a new
> way to handle time zones, but up through 2.3.11, I haven't had to
> change anything.
>
> Is there a setting to change?  I saw
> "ActiveRecord::Base.time_zone_aware_attributes = true" in the docs.
>
> The problem I have now is that is I pull a record from before the
> conversion, the created_at timestamp is correct at "Mon, 02 Feb 2009
> 10:59:10 UTC +00:00" because that was the local time here (ignoring
> the UTC part).  Now when I create a new record, I get "Tue, 12 Apr
> 2011 21:20:10 UTC +00:00" which is 5:20 Eastern.
>
>
> My ultimate question is, what should I do?  I'd hate to have to switch
> the app to use config.time_zone = "Eastern..." and then run a script
> to touch every single timestamp and convert it in the database...
>

That looks to me like what you will have to do. Set the system to the time
zone you want then run an SQL to fix all the incorrect entries.

B.

>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to