I have a rails application with events. My event table has a field called start_date that has a date and time type. Currently, when I save an event using the start_date field, which is chronic for parsing, the date receives the wrong save (or at least returns incorrectly).
Example: I saved the event and in the text box for start_date I entered 9/14/13 at 9am . He saved the data, refreshed the page, and the value in the text box was 9/14/13 at 11am . The value in the mysql table is 2013-09-14 16:00:00 .
What's going on here? This only happens on my server, not on local startup.
application.rb:
config.time_zone = 'Central Time (US & Canada)'
/ event.rb models:
class Event < ActiveRecord::Base belongs_to :user attr_accessible :description, :name, :start_date_string validate :name_not_blank validate :start_date_not_blank
helpers / application_helper.rb:
edit.html.erb
<span class="timestamp"><%= spell_date_and_time(event.start_date) %></span>
source share