method
find_zone
v5.2.3 -
Show latest stable
- Class:
Time
find_zone(time_zone)public
Returns a TimeZone instance matching the time zone provided. Accepts the time zone in any format supported by Time.zone=. Returns nil for invalid time zones.
Time.find_zone "America/New_York" # => #<ActiveSupport::TimeZone @name="America/New_York" ...> Time.find_zone "NOT-A-TIMEZONE" # => nil