summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-05 15:08:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-05 15:08:12 +0000
commit3c964ddb71a670f47500892dac704b3185ab72b4 (patch)
tree9a47ff29dbdaf28e0a64cabc100977bc18d34bf0 /lib
parent6a7a00325eff97f6649ffd1b63410dc8b3b53f5d (diff)
* lib/time.rb (Time.xmlschema): don't use float. fix
http://rubyforge.org/tracker/index.php?func=detail&group_id=426&atid=1698&aid=20504 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/time.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/time.rb b/lib/time.rb
index 2de21cd7c8..a37a067390 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -363,7 +363,7 @@ class Time
min = $5.to_i
sec = $6.to_i
usec = 0
- usec = $7.to_f * 1000000 if $7
+ usec = ($7[1..-1] + '000000')[0,6].to_i if $7
if $8
zone = $8
year, mon, day, hour, min, sec =
@@ -621,6 +621,8 @@ if __FILE__ == $0
t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
end
+
+ assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec)
end
def test_completion