时间格式 '%Y-%m-%d %H:%M:%S'

config/enviroment.rb
Add this into the last line:

ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(:default => '%Y-%m-%d %H:%M:%S')

你可能感兴趣的:(ruby,on,rails)