code: public long getDateField(String name) {
          HttpField field = getField(name);
          if (field == null)
              return -1;
  
          String val = valueParameters(field.getValue(), null);
          if (val == null)
              return -1;
  
          final long date = DateParser.parseDate(val);
          if (date == -1)
              throw new IllegalArgumentException("Cannot convert date: " + val);
          return date;
      }
docs: Get a header as a date value. Returns the value of a date field, or -1 if
  not found. The case of the field name is ignored.
  
  @param name the case-insensitive field name
  @return the value of the field as a number of milliseconds since unix
  epoch