1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

updated based on date2 3.9.6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2006-10-24 23:04:52 +00:00
parent e329433630
commit a95d67ebf7
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Wed Oct 25 07:59:42 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: updated based on date2 3.9.6.
[ruby-core:09323]
Wed Oct 25 00:58:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/mkexports.rb, win32/resource.rb: use unique variable names.

View file

@ -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