I’m not sure how to start… I’m not sure why ActiveSupport::TimeZone is even necessary, since TZInfo::Timezone seems to work just fine, and be more complete… but we had been using ActiveSupport for some reason, and I was unable to find the EST timezone in the available timezones. Am I missing something? Is there any reason that’s not included?
Is there any reason not to use TZInfo? Should everyone just be using TZInfo?
The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows Rails to do the following:
Source: The Rails 3 Way – 2nd Edition
EST is provided for in ActiveSupport::TimeZone, it’s named “Eastern Time (US & Canada)”. You can see all the time zones provided by ActiveSupport::TimeZone by calling TimeZone.all (provided ActiveSupport is included). EST is also included in US time zones, you can return a smaller collection of US-only time zones by calling TimeZone.us_zones. Accessing the TimeZone collection will provide a TimeZone preceded by it’s offset eg. TimeZone(“Eastern Time (US & Canada)”] => (GMT-05:00) Eastern Time (US & Canada).