summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-10-08 16:13:38 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-10-08 16:13:38 -0700
commit6f5fcb7d4e7388f2ba78f3b0b6b35563fd11135a (patch)
treeb9681274812ac8a1bb192a9763bc920151cc94d7 /lib
parent734a4046b5ac58a21559d43d7d44ddfa3a25cfa5 (diff)
downloadpsych-6f5fcb7d4e7388f2ba78f3b0b6b35563fd11135a.zip
testing another date format
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/visitors/to_ruby.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb
index 2f94be8..d4d6ac5 100644
--- a/lib/psych/visitors/to_ruby.rb
+++ b/lib/psych/visitors/to_ruby.rb
@@ -64,8 +64,10 @@ module Psych
time = Time.utc(yy, m, dd, hh, mm, ss)
+ us = md[2] ? md[2].sub(/^\./, '').to_i : 0
+
tz = (!md[3] || md[3] == 'Z') ? 0 : Integer(md[3].split(':').first)
- Time.at((time - (tz * 3600)).to_i, md[2].sub(/^\./, '').to_i)
+ Time.at((time - (tz * 3600)).to_i, us)
else
token.last
end