This project is archived and is in readonly mode.

#1095 ✓resolved
Andrew Vit

Time columns don't handle timezone correctly

Reported by Andrew Vit | September 22nd, 2008 @ 10:50 PM | in 2.x

When saving to a :time column, the value is converted to the database timezone (expect UTC in a normal setting).

When reading the value back from the database, the time value has no timezone (since time fields don't store this information) and the value is read back verbatim, and thus shifted.

I'm working around this with the following accessor:


def mon_open
  self[mon_open] && self[mon_open].in_time_zone
end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Tags

Referenced by

Pages