rails 中 date 输出 格式

If you want to change or add formats, put something like this in your
environment.rb after the end of the Initializer block:

ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
   :default => '%m/%d/%Y',
   :date_time12  => "%m/%d/%Y %I:%M%p",
   :date_time24  => "%m/%d/%Y %H:%M",
 )


reboot server

http://www.ruby-forum.com/topic/57923

你可能感兴趣的:(Ruby,Rails)