title: Rails saving datetime to MySQL database
body: <p>I have a simple function within my model to set a completed datetime column in a database. this function worked until I tried to change the default rails format for datetime.</p>
  
  <p>After reading up on the issues with mysql datetime format and rails I decided to take out the formating code I had in the environment.rb </p>
  
  <p>It still does not save though. I want it to save the same way that created_at etc. save. I can then format the display of the date.</p>
  
  <p>I have restarted the web server</p>
  
  <p>Model:</p>
  
  <pre><code>def self.complete(id)
     update(id, :completed_at =&gt; Time.now)
  end
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>Class.complete(params[:id])
  </code></pre>