From: Tadayoshi Funaba Date: 2004-01-17T20:05:53+09:00 Subject: Re: Date Class and GMT At 2003-11-27T01:42:12+0900 markjreed@mail.com (Mark J. Reed) wrote: > However, as I have posted here before, there is a bug in this > library which for some reason automatically increases the time zone > offset from UTC by one minute, so if you run the above examples on your > system you will probably see -0501 instead of -0500. This problem is > easily fixed by removing the line I've just read your mail. I don't read nearly all discussions in English now. I think you are right. I intended to consider leap seconds. But, I was in confusion. Thank you for your report. --tadf --- date.rb 2003-08-12 05:09:41+09 2.9 +++ date.rb 2004-01-17 16:51:52+09 @@ -1,4 +1,4 @@ -# date.rb: Written by Tadayoshi Funaba 1998-2003 +# date.rb: Written by Tadayoshi Funaba 1998-2004 # $Id: date.rb,v 2.9 2003-08-12 05:09:41+09 tadf Exp tadf $ require 'rational' @@ -508,8 +508,7 @@ jd = civil_to_jd(*(a[0,3] << sg)) fr = time_to_day_fraction(*(a[3,3])) + i.usec.to_r/86400000000 d = Time.gm(*i.to_a).to_i - i.to_i - d += d / d.abs if d.nonzero? - of = (d / 60).to_r/1440 + of = (d / 60.0).round.to_r/1440 new0(jd_to_ajd(jd, fr, of), of, sg) end