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
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
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
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
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
5 matches
Mail list logo