diff options
author | Jamis Buck <jamis@37signals.com> | 2005-10-03 18:30:03 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-10-03 18:30:03 +0000 |
commit | ac419a06559a884c7a5839631be9e062d4498646 (patch) | |
tree | 35b138d79bcaa7624bcb0260ba467cb5417c77a0 /activesupport/lib | |
parent | 33f78d822759aed125b2fb8fe0a9b3a5704d3239 (diff) | |
download | rails-ac419a06559a884c7a5839631be9e062d4498646.tar.gz rails-ac419a06559a884c7a5839631be9e062d4498646.tar.bz2 rails-ac419a06559a884c7a5839631be9e062d4498646.zip |
Add :rfc822 as an option for Time#to_s (to get rfc822-formatted times)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/conversions.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb index fadfb6b0df..6e7299762d 100644 --- a/activesupport/lib/active_support/core_ext/time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/time/conversions.rb @@ -6,9 +6,10 @@ module ActiveSupport #:nodoc: # Getting times in different convenient string representations and other objects module Conversions DATE_FORMATS = { - :db => "%Y-%m-%d %H:%M:%S", - :short => "%e %b %H:%M", - :long => "%B %e, %Y %H:%M" + :db => "%Y-%m-%d %H:%M:%S", + :short => "%e %b %H:%M", + :long => "%B %e, %Y %H:%M", + :rfc822 => "%a, %d %b %Y %H:%M:%S %z" } def self.append_features(klass) @@ -32,4 +33,4 @@ module ActiveSupport #:nodoc: end end end -end
\ No newline at end of file +end |