code: private long expiryDate2DeltaSeconds(String dateString) {
          Calendar cal = new GregorianCalendar(GMT);
          for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
              SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
                                                         Locale.US);
              cal.set(1970, 0, 1, 0, 0, 0);
              df.setTimeZone(GMT);
              df.setLenient(false);
              df.set2DigitYearStart(cal.getTime());
              try {
                  cal.setTime(df.parse(dateString));
                  if (!COOKIE_DATE_FORMATS[i].contains("yyyy")) {
                      // 2-digit years following the standard set
                      // out it rfc 6265
                      int year = cal.get(Calendar.YEAR);
                      year %= 100;
                      if (year < 70) {
                          year += 2000;
                      } else {
                          year += 1900;
                      }
                      cal.set(Calendar.YEAR, year);
                  }
                  return (cal.getTimeInMillis() - whenCreated) / 1000;
              } catch (Exception e) {
                  // Ignore, try the next date format
              }
          }
          return 0;
      }
docs: /*
  @param dateString        a date string in one of the formats
  defined in Netscape cookie spec
  
  @return                  delta seconds between this cookie's creation
  time and the time specified by dateString