aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date_time/conversions.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-07-29 12:28:19 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2013-07-29 12:31:20 +0100
commit88c0ef4d4fc86faefeec5bfff87ad882f62468d8 (patch)
tree395cf236c5bb23795dcffb613cdc7721b3da1554 /activesupport/lib/active_support/core_ext/date_time/conversions.rb
parentcde979c38832b99d8c85b5f44f7357931ade1ee0 (diff)
downloadrails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.tar.gz
rails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.tar.bz2
rails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.zip
Fix handling of offsets with Time#to_s(:iso8601)
Use a lambda to ensure that the generated string respects the offset of the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601) for completeness.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/date_time/conversions.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb
index c44626aed9..6ddfb72a0d 100644
--- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb
@@ -19,6 +19,7 @@ class DateTime
# datetime.to_formatted_s(:long) # => "December 04, 2007 00:00"
# datetime.to_formatted_s(:long_ordinal) # => "December 4th, 2007 00:00"
# datetime.to_formatted_s(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000"
+ # datetime.to_formatted_s(:iso8601) # => "2007-12-04T00:00:00+00:00"
#
# == Adding your own datetime formats to to_formatted_s
# DateTime formats are shared with Time. You can add your own to the