This project is archived and is in readonly mode.

#6516 ✓invalid
Jerome

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

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

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

Comments and changes to this ticket

  • Andrew White

    Andrew White March 4th, 2011 @ 06:55 AM

    • 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.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages