function strftime(R,C){var Z,o,x,k=R.split("");var a=(C)?new Date(C):new Date();for(Z=0,x=R.length;Z<=x;Z++){if(k[Z]=="%"){k[Z++]="";switch(k[Z]){case "a":k[Z]=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][a.getDay()];break;case "A":k[Z]=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a.getDay()];break;case "h":case "b":k[Z]=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()];break;case "B":k[Z]=["January","February","March","April","May","June","July","August","September","October","November","December"][a.getMonth()];break;case "c":k[Z]=strftime("%m/%d/%y %H:%M:%S",a.getTime());break;case "C":k[Z]=Math.floor(a.getFullYear()/100);break;case "d":o=a.getDate();k[Z]=(o<10)?"0"+o:o;break;case "D":k[Z]=strftime("%m/%d/%y",a.getTime());break;case "e":o=a.getMonth();k[Z]=(o<10)?" "+o:o;break;case "g":k[Z]="";break;case "G":k[Z]="";break;case "H":o=a.getHours();k[Z]=(o<10)?"0"+o:o;break;case "I":o=a.getHours();if(o==0){o=24;}if(12<o){o-=12;}k[Z]=(o<10)?"0"+o:o;break;case "j":o=Math.ceil((a.getTime()-new Date(a.getFullYear(),0,1).getTime())/86400000);k[Z]=(o<100)?(o<10)?"00"+o:"0"+o:o;break;case "m":o=a.getMonth()+1;k[Z]=(o<10)?"0"+o:o;break;case "M":k[Z]=a.getMinutes();break;case "n":k[Z]="\n";break;case "p":o=a.getHours();k[Z]=(o<12)?"AM":"PM";break;case "r":o=a.getHours();k[Z]=(o<12)?o:o-12;break;case "R":k[Z]=a.getHours();break;case "S":k[Z]=a.getSeconds();break;case "t":k[Z]="\t";break;case "T":k[Z]=strftime("%H:%M:%S",a.getTime());break;case "u":o=a.getDay();k[Z]=(o==0)?7:o;break;case "U":o=(a.getTime()-new Date(a.getFullYear(),0,1).getTime());k[Z]=Math.ceil(o/604800000);break;case "V":k[Z]="";break;case "W":o=(a.getTime()-new Date(a.getFullYear(),0,1).getTime());k[Z]=Math.floor(o/604800000);break;case "w":k[Z]=a.getDay();break;case "x":o=a.toLocaleString();k[Z]=o.slice(0,o.indexOf(" "));break;case "X":o=a.toLocaleString();k[Z]=o.slice(o.indexOf(" "));break;case "y":k[Z]=a.getFullYear().toString().slice(-2);break;case "Y":k[Z]=a.getFullYear();break;case "Z":k[Z]="";break;case "%":k[Z]="%";break;default:k[Z]="";break;}}}return k.join("");}