From 22dc11c6b17c22247b4e3d1b2b0329d9ca638da6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 1 Oct 2007 02:16:15 +0000 Subject: Fixed Date#xmlschema for dates outside the range of what can be created with Time (closes #9744) [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/date_time/conversions.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib/active_support') 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 4739e3fb6d..776f1806f9 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -45,6 +45,10 @@ module ActiveSupport #:nodoc: def to_datetime self end + + def xmlschema + strftime("%Y-%m-%dT%H:%M:%S#{offset == 0 ? 'Z' : '%Z'}") + end end end end -- cgit v1.2.3