aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-07-11 10:00:28 -0700
committerJosé Valim <jose.valim@gmail.com>2011-07-11 10:00:28 -0700
commit133a20354ef9872721e3b825daaf8eca686b4d37 (patch)
tree6da752150911805da2427a0878e06979040cb32d /activesupport/lib/active_support
parent91bba2181576c32bda4825741beb94c58395736d (diff)
parentc2b79c011f4ec39426c93812ab58660718c7cb92 (diff)
downloadrails-133a20354ef9872721e3b825daaf8eca686b4d37.tar.gz
rails-133a20354ef9872721e3b825daaf8eca686b4d37.tar.bz2
rails-133a20354ef9872721e3b825daaf8eca686b4d37.zip
Merge pull request #1756 from shtirlic/xmlschema_fix
Fix xmlschema output with fraction_digits >0
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 3d092529d6..ec2c717942 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -109,7 +109,7 @@ module ActiveSupport
def xmlschema(fraction_digits = 0)
fraction = if fraction_digits > 0
- ".%i" % time.usec.to_s[0, fraction_digits]
+ (".%06i" % time.usec)[0, fraction_digits + 1]
end
"#{time.strftime("%Y-%m-%dT%H:%M:%S")}#{fraction}#{formatted_offset(true, 'Z')}"