From: "nobu (Nobuyoshi Nakada)" Date: 2013-10-17T22:21:32+09:00 Subject: [ruby-core:57914] [ruby-trunk - Bug #9032][Feedback] Time.round reverts the DST status of the time Issue #9032 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Feedback Priority changed from Urgent to Normal I can't reproduce it. What's your timezone? $ TZ=Europe/Paris ~/ruby/2.0.0-p0/bin/ruby -v -rtime -e 't1 = Time.new(2013, 10, 27, 2, 30, 0); t2 = t1.round(3); [t1, t2].each {|t|p [t, t.dst?, t.zone]}' ruby 2.0.0p0 (2013-02-24 revision 39474) [universal.x86_64-darwin11.0] [2013-10-27 02:30:00 +0100, false, "CET"] [2013-10-27 02:30:00 +0100, false, "CET"] And it seems an irb session, but why it prints time objects in old format? ---------------------------------------- Bug #9032: Time.round reverts the DST status of the time https://bugs.ruby-lang.org/issues/9032#change-42502 Author: mayanks (Mayank Sharma) Status: Feedback Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN If the time is in non-DST and round method is applied, then the resulting time goes back to DST time. This happens only during the 1 hour when time goes back. Following example should explain the situation better. 2.0.0-p0 :057 > d => Sun, 27 Oct 2013 02:30:00 CET +01:00 2.0.0-p0 :058 > d.isdst => false 2.0.0-p0 :059 > d.round(3) => Sun, 27 Oct 2013 02:30:00 CEST +02:00 2.0.0-p0 :060 > d.round(3).isdst => true I have set the priority Urgent as the DST is going to elapse in 10 days from now. -- http://bugs.ruby-lang.org/