0

I have a model english_grade which has a column grade_datetime which is a datetime selected by the user in a form.

  <div class="field">
    <%= f.label :grade_datetime %>
    <%= f.datetime_select :grade_datetime %>
  </div>

When I display the value on a view. Locally they appear as datetime (e.g. which is 2016-09-13 23:25:00 +0100), whereas in Heroku they appear as date (e.g. 2016-09-14). I'm not sure what would be the most useful information to include but I have tried to set my timezone to London (my location).

I'm not sure from a high level perspective where I should be looking to solve this problem and can't find anything on Google. Will edit question appropriately based on what additional information anyone thinks would be relevant.

Any ideas of what could be causing the issue or requests for extra info would be appreciated! Thanks a lot!!!!

Jack Bridger
  • 165
  • 2
  • 14
  • 1
    Check this post out. Happened to me a while back and this solved it! http://stackoverflow.com/questions/9571392/ignoring-timezones-altogether-in-rails-and-postgresql/9576170#9576170 – bkunzi01 Sep 14 '16 at 12:06
  • 1
    The answer here might be helpful: http://stackoverflow.com/questions/2719330/why-does-heroku-log-using-the-server-time-rather-than-the-rails-time-zone – NM Pennypacker Sep 14 '16 at 12:19
  • Thanks guys, @bkunzi01 because this value isn't a timestamp - it's actually manually selected and stored as datetime, do you think it still applies? – Jack Bridger Sep 14 '16 at 12:43

0 Answers0