In config/application.rb, I have set the time zone to EST:
config.time_zone = 'Eastern Time (US & Canada)'
The production server has the CST time zone. Consequently, all my date times are displaying the time in CST instead of EST. The time is stored properly as UTC in the database.
EST: -0500
CST: -0600
Database in UTC: 18:15:00
Displayed in CST: 12:15:00
Want in EST: 13:15:00
The schema for the column date_time is:
t.datetime "date_time"
In the view, I call date_time like:
<%= Show.find(1).date_time.strftime('%H:%M') %>
How can I enforce all the time to display in EST across the web site?
Turns out it is a bug in the way I was constructing the Time object. The following construct will pick up the default zone
Central Timeof the server:I have to specify the time zone described in
config.time_zonewhich picks upESTproperly: