code: public String doFormatDate(long date) {
          buf.setLength(0);
          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);
          int century = year / 100;
          year = year % 100;
  
          int hours = gc.get(Calendar.HOUR_OF_DAY);
          int minutes = gc.get(Calendar.MINUTE);
          int seconds = gc.get(Calendar.SECOND);
  
          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, century);
          StringUtils.append2digits(buf, year);
  
          buf.append(' ');
          StringUtils.append2digits(buf, hours);
          buf.append(':');
          StringUtils.append2digits(buf, minutes);
          buf.append(':');
          StringUtils.append2digits(buf, seconds);
          buf.append(" GMT");
          return buf.toString();
      }
docs: Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
  
  @param date the date in milliseconds
  @return the formatted date