[Rails] Re: Use a Time Zone without setting Time.zone?

2009-04-07 Thread Rick Schumeyer
Either I'm not understanding what you want, or this is real easy. Let's say I have a class Event with a field edate, which is stored in UTC: >> e = Event.find(1) => # >> e.edate => Mon, 30 Mar 2009 12:00:00 UTC +00:00 >> e.edate.class => ActiveSupport::TimeWithZone Now Let's say you want the ti

[Rails] TimeWithZone seems in rails 2.3 seems broken...is this the correct behavior?

2009-03-31 Thread Rick Schumeyer
My environment.rb contains config.time_zone = 'UTC' If my understanding is correct, rails should assume time values coming from the database are UTC, and since config.time_zone is set to 'UTC', it should not try to convert the times. Instead, rails is assuming that the db values are Eastern (my

[Rails] Rails 2.3 and TimeZone

2009-03-30 Thread Rick Schumeyer
My rails 2.3 app is interpreting times retrieved from the database as local (in my case, Eastern) instead of UTC. I created a test table in a SQL Server database with one row. The table is called events and contains an "edate" column. The value is "2009-03-30 12:00", and is a UTC time. environ

[Rails] Re: TimeZone confusion

2009-03-28 Thread Rick Schumeyer
That line was already there, and is not commented. On Mar 28, 2:22 am, Danny Burkes wrote: > > How can I tell rails that the times *are* UTC and to leave them alone? > > Put > >   config.time_zone = 'UTC' > > in your environment.rb.  Actually if you look closely, it's probably > already there, j

[Rails] TimeZone confusion

2009-03-27 Thread Rick Schumeyer
I'm using rails 2.3.2. I have Date/Time data stored in a SQL Server database. All values are UTC (although the database just stores the time, not the zone). All of my computers are in the America/New York time zone. It was my understanding that rails expects a UTC time to come from the databas