title: Ruby - DateTime for Database
body: <p>I have a Database column with the syntax "0000-00-00 00:00:00".
  In PHP I would do 
  date('Y-m-d H:i:s');</p>
  
  <p>In Ruby, I do</p>
  
  <pre><code>require 'date'
  now = DateTime::now()
  puts "#{now.year()}-#{now.mon()}-#{now.mday()} #{now.hour()}:#{now.min()}:#{now.sec()}"
  </code></pre>
  
  <p>The result is: 
  "2010-1-5 10:16:4"
  That's not okay. How could I create a "timestring" with the format "0000-00-00 00:00:00"?</p>
  
  <p>Thanks a lot in advance &amp; Best Regards</p>