summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors/yaml_tree.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-05 23:12:44 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-05 23:12:44 +0000
commitc27e0ebab690d2a6c709a5a2c83af2d7a4968492 (patch)
tree296e757a7198b972cef76f911074e501c67aa844 /ext/psych/lib/psych/visitors/yaml_tree.rb
parentf32ae44629199af0462be3ac15359a9ad7c56999 (diff)
* ext/psych/lib/psych/visitors/yaml_tree.rb (format_time): nanoseconds
require more digits when dumping. Thanks akr! [ruby-core:31047] * test/psych/visitors/test_to_ruby.rb: adjusting tests for nanoseconds git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/visitors/yaml_tree.rb')
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index ebafffd7c9..4df7b4d5db 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -271,9 +271,9 @@ module Psych
def format_time time
formatted = time.strftime("%Y-%m-%d %H:%M:%S")
if time.utc?
- formatted += ".%06dZ" % [time.nsec]
+ formatted += ".%09dZ" % [time.nsec]
else
- formatted += ".%06d %+.2d:%.2d" % [time.nsec,
+ formatted += ".%09d %+.2d:%.2d" % [time.nsec,
time.gmt_offset / 3600, time.gmt_offset % 3600 / 60]
end
formatted