title: How to display local time on form when column has type datetime is saved in database in UTC
body: <p>I have a column called <strong><code>test_date</code></strong>, type <code>datetime</code> in General Exam table. I built a form to create and update GeneralExam, on form, I allow User choose a date and time throught <a href="http://trentrichardson.com/examples/timepicker/" rel="nofollow"><code>jQuery UI Datepicker</code></a>.</p>
  
  <p>After user choose date and time, it will displayed in textfield, like:</p>
  
  <p><code>25-11-2012 16:30</code></p>
  
  <p>It is my current time. When I run in console, I see the <code>test_date</code> was saved in database is:</p>
  
  <p><code>2012-11-25 09:30:00</code></p>
  
  <p>And when I get object GeneralExam, and get <code>test_date</code> value, it is:</p>
  
  <pre><code>g = GeneralExam.last
  g.test_date
  =&gt; Sun, 25 Nov 2012 16:30:00 ICT +07:00
  </code></pre>
  
  <p>I think <code>test_date</code> is converted, because I set up in <code>application.rb</code> is:</p>
  
  <pre><code>config.time_zone = 'Hanoi'
  </code></pre>
  
  <p>But when I update a General Exam on form, it still display the time was saved in database, not my local timezone, it means it display:</p>
  
  <p><code>2012-11-25 09:30:00</code></p>
  
  <p>But I want it is like what I chose on form:</p>
  
  <p><code>25-11-2012 16:30:00</code></p>
  
  <p>How can I set up for display datetime column in local time? </p>
  
  <p>And I think the order of date was reversed, when I choose date, it is <code>25-11-2012</code>, but when it displayed it was <code>2012-11-25</code>, Why it reversed the order?</p>