I come across what seems like a simple problem to me, but I can’t understand what I am doing wrong. In my application, users can add their course through a simple form_for. They can enter start_time and end_time for course lectures, for example:
<div class="field">
Start Time<br />
<%= time_select :course, :start_time, { :minute_step => 5, :ampm => true } %>
</div>
<div class="field">
End Time<br />
<%= time_select :course, :end_time, { :minute_step => 5, :ampm => true } %>
</div>
I set my timezone in the .rb application for installation in Eastern time, and this seems to work correctly since created_at is returning to the correct timezone.
However, the problem I am facing is that start_time and end_time are entered as UTC in the database. Therefore, when a user selects a class starting at 10:00, it is entered as 10 UTC, not 10 AM EST / 15: 00 UTC. What am I missing here? It seems like I want this to happen.
source
share