code: synchronized public static String getOldCookieDate(long time) {
  
          if (OLD_COOKIE.getTimeZone() != GMT_TIMEZONE) {
              // ensure GMT is used as time zone for the header generation
              OLD_COOKIE.setTimeZone(GMT_TIMEZONE);
          }
  
          try {
              return OLD_COOKIE.format(new Date(time));
          } catch (Throwable t) {
              return OLD_COOKIE.format(new Date());
          }
      }
docs: Returns a formatted date and time String form a timestamp value based on the
  (old) Netscape cookie date format.<p>
  
  @param time the time value to format as date
  @return the formatted date