rem: * @param date *   the date as a JavaScript Date object * @returns 
add: * @param date : Date *   the date to process * @returns string 
context: function toDateString(date){  //  // rfc1123-date = wkday "," SP date1 SP time SP "GMT"  // date1        = 2DIGIT SP month SP 4DIGIT  //                ; day month year (e.g., 02 Jun 1982)  // time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT  //                ; 00:00:00 - 23:59:59  // wkday        = "Mon" | "Tue" | "Wed"  //              | "Thu" | "Fri" | "Sat" | "Sun"  // month        = "Jan" | "Feb" | "Mar" | "Apr"  //              | "May" | "Jun" | "Jul" | "Aug"  //              | "Sep" | "Oct" | "Nov" | "Dec"  //  const wkdayStrings = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];  const monthStrings = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",                        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];  /**   * Processes a date and returns the encoded UTC time as a string according to   * the format specified in RFC 2616.   *   * @param date   *   the date as a JavaScript Date object   * @returns   *   a string of the form "HH:MM:SS", ranging from "00:00:00" to "23:59:59"   */  function toTime(date)  {    var hrs = date.getUTCHours();    var rv  = (hrs < 10) ? "0" + hrs : hrs;        var mins = date.getUTCMinutes();    rv += ":";    rv += (mins < 10) ? "0" + mins : mins;    var secs = date.getUTCSeconds();    rv += ":";    rv += (secs < 10) ? "0" + secs : secs;    return rv;  }  /**   * Processes a date and returns the encoded UTC date as a string according to   * the date1 format specified in RFC 2616.   *   * @param date   *   the date as a JavaScript Date object   * @returns   *   a string of the form "HH:MM:SS", ranging from "00:00:00" to "23:59:59"   */  function toDate1(date)  {    var day = date.getUTCDate();    var month = date.getUTCMonth();    var year = date.getUTCFullYear();    var rv = (day < 10) ? "0" + day : day;    rv += " " + monthStrings[month];    rv += " " + year;    return rv;  }  date = new Date(date);  const fmtString = "%wkday%, %date1% %time% GMT";  var rv = fmtString.replace("%wkday%", wkdayStrings[date.getUTCDay()]);  rv = rv.replace("%time%", toTime(date));  return rv.replace("%date1%", toDate1(date));}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/4424fe78e8c7d380e10559e1b6c801b716baf045/httpd.js/clean/netwerk/test/httpserver/httpd.js