def in_config_zone time, config: nil
      if time.respond_to? :in_time_zone
        time.in_time_zone(config[:time_zone])
      elsif time.is_a? Date
        config[:time_zone].local(time.year, time.month, time.day)
      else
        raise TypeError.new("Can't convert #{time.class} to a Time")
      end
    end
def in_config_zone time, config: nil
      if time.respond_to? :in_time_zone
        time.in_time_zone(config[:time_zone])
      elsif time.is_a? Date
        config[:time_zone].local(time.year, time.month, time.day)
      else
        raise TypeError.new("Can't convert #{time.class} to a Time")
      end
    end
fix for ActiveRecord < 4, doesn't implement in_time_zone for Date