Rails Timezones End in 2051 #7353

Closed
gotoAndBliss opened this Issue Aug 15, 2012 · 4 comments

Comments

Projects
None yet
4 participants

Here goes :

    Time.zone.now => "Eastern Time (US & Canada)"
    Time.zone.now => Wed, 15 Aug 2012 06:05:37 EDT -04:00
    Time.zone.now + 39.years => Tue, 15 Aug 2051 06:06:03 EST -05:00

And so you have it, the end of our fabled Eastern Daylight Time has been prophesied by Ruby on Rails to end in the year 2051.

Also works for any other TimeZone changing area.

    Time.zone
     => "Pacific Time (US & Canada)" 
    1.9.2p180 :003 > Time.zone.now
     => Wed, 15 Aug 2012 03:08:57 PDT -07:00 
    1.9.2p180 :004 > Time.zone.now + 39.years
     => Tue, 15 Aug 2051 03:08:57 PST -08:00 

This exists in Rails 3.0 and in Rails 3.2.6

Member

robin850 commented Aug 15, 2012

Hello @gotoAndBliss,

It's not a Rails issue, 12 + 39 = 51. I use Rails 3.2.6 and I can go farther than 2051:

Loading development environment (Rails 3.2.6)
irb(main):001:0> Time.zone
=> (GMT+01:00) Paris
irb(main):002:0> Time.zone.now
=> Wed, 15 Aug 2012 12:38:01 CEST +02:00
irb(main):003:0> Time.zone.now + 45.years
=> Wed, 15 Aug 2057 12:38:18 CET +01:00

Have a nice day.

Robin850, your timezone should have remained CEST. The bug remains true.

Contributor

beerlington commented Aug 15, 2012

I think the issue title is a little confusing. Timezones don't end, but the notion of daylight savings appears to end.

Just a confirmation. But this is irrelevant to Rails, and this is actually Ruby's Time Class that is causing this error.

Not sure how the Rails community wants to deal with this.

+1 to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment