Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Daylight savings handling is broken in #<Method: Time(ActiveSupport::CoreExtensions::Time::Calculations)#+>

#6516

Hey,

I don't know if this is a duplicate of an existing defect. Some of my tests started to fail today because of how daylight savings is being handled within <Method: Time(ActiveSupport::CoreExtensions::Time::Calculations)#+>

ree-1.8.7-2010.02 > Time.now

=> Fri Mar 04 09:06:09 +1100 2011

ree-1.8.7-2010.02 > Time.now + 30.days

=> Sun Apr 03 09:06:15 +1000 2011

ree-1.8.7-2010.02 > Time.at(Time.now.to_i + 30.days)

=> Sun Apr 03 08:06:33 +1000 2011

ree-1.8.7-2010.02 > Time.now.method(:+)

=> #<Method: Time(ActiveSupport::CoreExtensions::Time::Calculations)#+>

At moment it is daylight savings here in Melbourne Australia (GMT+11) but it changes back to GMT+10 in just under a month.

Cheers
Jerome

Reported by Jerome · March 4th, 2011 @ 01:06 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Andrew White
    Andrew White
    • State changed from new to invalid
    • Importance changed from to Low

    The time calculation methods are sensitive to the duration that you add/subtract. If you specify a period like 30.days or 1.month it will keep the same time across DST boundaries, however if you specify a period like 720.hours then the time will change.

    March 4th, 2011 @ 06:55 AM