I've got a Database column using the syntax "0000-00-00 00:00:00". In PHP I'd do date('Y-m-d H:i:s')

In Ruby, I actually do

require 'date'
now = DateTime::now()
puts "#{now.year()}-#{now.mon()}-#{now.mday()} #{now.hour()}:#{now.min()}:#{now.sec()}"

It makes sense: "2010-1-5 10:16:4" That isn't okay. How could I produce a "timestring" using the format "0000-00-00 00:00:00"?

Thanks ahead of time &lifier Sincerely

You are able to format the dates as with PHP because of the built-in Time class, see documentation there.

This could give for the situation :

t = Time.now
puts t.strftime("%Y-%m-%d %H:%M:%S")