diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-24 23:04:52 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-24 23:04:52 +0000 |
commit | a95d67ebf754728986f2506ea507be14dd4d24a4 (patch) | |
tree | 333e2218750093a3de2a16581a8b2b5ecccdf20b /lib/date/format.rb | |
parent | e32943363088035c04b63b54cbe5179c4f5cd527 (diff) | |
download | ruby-a95d67ebf754728986f2506ea507be14dd4d24a4.tar.gz |
updated based on date2 3.9.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
-rw-r--r-- | lib/date/format.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 55f7d95811..14726b081c 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -1,5 +1,5 @@ # format.rb: Written by Tadayoshi Funaba 1999-2006 -# $Id: format.rb,v 2.27 2006-09-30 13:10:32+09 tadf Exp $ +# $Id: format.rb,v 2.28 2006-10-25 06:45:12+09 tadf Exp $ require 'rational' @@ -280,10 +280,10 @@ class Date when /\A(:{0,3})z/ t = $1.size sign = if offset < 0 then -1 else +1 end - fr = offset.abs.to_f - hh, fr = fr.divmod(1.0/24) - mm, fr = fr.divmod(1.0/1440) - ss, fr = fr.divmod(1.0/86400) + fr = offset.abs + hh, fr = fr.divmod(1.to_r/24) + mm, fr = fr.divmod(1.to_r/1440) + ss, fr = fr.divmod(1.to_r/86400) if t == 3 if ss.nonzero? then t = 2 elsif mm.nonzero? then t = 1 |