mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
6a7a00325e
commit
3c964ddb71
2 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue