diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 15:08:12 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 15:08:12 +0000 |
| commit | 3c964ddb71a670f47500892dac704b3185ab72b4 (patch) | |
| tree | 9a47ff29dbdaf28e0a64cabc100977bc18d34bf0 | |
| parent | 6a7a00325eff97f6649ffd1b63410dc8b3b53f5d (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
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/time.rb | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Jun 6 00:05:33 2008 Tanaka Akira <akr@fsij.org> + + * 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 + Thu Jun 5 20:30:46 2008 Akinori MUSHA <knu@iDaemons.org> * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize): 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 |
