This project is archived and is in readonly mode.
Daylight saving timezone not recognized
Reported by Marc-André Lafortune | March 14th, 2011 @ 02:57 PM
While the time zone "EST" is recognized, "EDT" isn't.
Time.now.zone # => "EST" last week, "EDT" this week.
Time.now.in_time_zone("EST").to_s # => ".... -0500"
Time.now.in_time_zone("EDT").to_s # => raises an error, see issue 6573
Comments and changes to this ticket
-
Josh Kalderimis March 15th, 2011 @ 08:53 PM
- Tag changed from rails3 activesupport, bug, timezone to active_support, timezone
- State changed from new to wontfix
- Importance changed from to Low
Hi Marc,
The EST timezone is defined in the TZInfo gem. I looked into it further and EDT is defined but it is called EST5EDT.
Thanks,
Josh
-
Marc-André Lafortune March 15th, 2011 @ 10:45 PM
Thanks for looking it up.
For the record, EST5EDT is not quite "EDT". It is the same as "Eastern Time (US & Canada)", i.e. EST (UTC-5) in the 'winter', and 'EDT' (UTC-4) in the 'summer'.
So "EDT" is not an actual timezone, more like the state of a timezone. For instance it would not make any sense to ask for Time.utc(2011,1,1).in_time_zone("EDT"). Note that "EST" is a timezone, used in a few places that do not use Daylight savings time and are (UTC-5) yearlong.
Sorry for my confusion.
-
Josh Kalderimis March 15th, 2011 @ 11:49 PM
Hey Marc,
Thanks for the reply and for letting me know what the real issue / solution is.
Josh
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>