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
- Tag changed from rails3 activesupport, bug, timezone to active_support, timezone
- State changed from new to wontfix
- Importance changed from to Low
The EST timezone is defined in the TZInfo gem. I looked into it further and EDT is defined but it is called EST5EDT.
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.