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 | 87c91cb99456b08b2b2e8dd2ddb15acc1fce8b0b (patch) | |
| tree | 333e2218750093a3de2a16581a8b2b5ecccdf20b /lib/date/format.rb | |
| parent | 147f54c65a91d4e74b5410b7e3ebd2b01816c58e (diff) | |
| download | ruby-87c91cb99456b08b2b2e8dd2ddb15acc1fce8b0b.tar.gz ruby-87c91cb99456b08b2b2e8dd2ddb15acc1fce8b0b.tar.xz ruby-87c91cb99456b08b2b2e8dd2ddb15acc1fce8b0b.zip | |
updated based on date2 3.9.6.
git-svn-id: http://svn.ruby-lang.org/repos/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 55f7d9581..14726b081 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 |
