I am having a rough time getting a Rails 5 view (hosted on a Heroku dyno) to render a consistent timestamp value. The Heroku support team can't figure out the issue.
1) I visit the specific view (an order form) and observe a datetime value rendering is incorrect. The time code should be 2000-01-01 01:06:10 but instead reads 1999-12-31 19:06:10.
This is what is fully rendered below in the html.erb view (sourced from a datetime column in Postgres):
1999-12-31 19:06:10 -0600
The code used to render this timestamp is simple: item.time_start which is from a Model named Item with an attribute/column named time_start. No other formatting is going on with this process.
2) I then click on the Restart All Dynos link on the Heroku Dashboard
3) I immediately visit the same page and observe the time code as correct:
2000-01-01 01:06:10 UTC
Does anyone have ideas why this change would occur randomly during each day? Why does a server restart change the timestamp presentation?
create_table "order_items", force: :cascade do |t|
t.time "time_start"
t.time "time_end"
end
Ruby 2.4.1
Rails 5.0.2
Postgres 9.6.2
production.rb setting: config.time_zone = "UTC"