class Time

def find_zone!(time_zone)

Returns a TimeZone instance or nil, or raises an ArgumentError for invalid timezones.
def find_zone!(time_zone)
  if !time_zone || time_zone.is_a?(ActiveSupport::TimeZone)
    time_zone
  else
    # lookup timezone based on identifier (unless we've been passed a TZInfo::Timezone)
    unless time_zone.respond_to?(:period_for_local)
      time_zone = ActiveSupport::TimeZone[time_zone] || TZInfo::Timezone.get(time_zone)
    end
    # Return if a TimeZone instance, or wrap in a TimeZone instance if a TZInfo::Timezone
    if time_zone.is_a?(ActiveSupport::TimeZone)
      time_zone
    else
      ActiveSupport::TimeZone.create(time_zone.name, nil, time_zone)
    end
  end
rescue TZInfo::InvalidTimezoneIdentifier
  raise ArgumentError, "Invalid Timezone: #{time_zone}"
end