code: public void doFormatCookieDate(StringBuilder buf, long date) {
          gc.setTimeInMillis(date);
  
          int day_of_week = gc.get(Calendar.DAY_OF_WEEK);
          int day_of_month = gc.get(Calendar.DAY_OF_MONTH);
          int month = gc.get(Calendar.MONTH);
          int year = gc.get(Calendar.YEAR);
          year = year % 10000;
  
          int epoch = (int) ((date / 1000) % (60 * 60 * 24));
          int seconds = epoch % 60;
          epoch = epoch / 60;
          int minutes = epoch % 60;
          int hours = epoch / 60;
  
          buf.append(DAYS[day_of_week]);
          buf.append(',');
          buf.append(' ');
          StringUtils.append2digits(buf, day_of_month);
  
          buf.append('-');
          buf.append(MONTHS[month]);
          buf.append('-');
          StringUtils.append2digits(buf, year / 100);
          StringUtils.append2digits(buf, year % 100);
  
          buf.append(' ');
          StringUtils.append2digits(buf, hours);
          buf.append(':');
          StringUtils.append2digits(buf, minutes);
          buf.append(':');
          StringUtils.append2digits(buf, seconds);
          buf.append(" GMT");
      }
docs: Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies
  
  @param buf  the buffer to format the date into
  @param date the date in milliseconds