case'H'://Hour (24-hour clock) as a decimal number [00,23].
out+=(tm.tm_hour).toFixed(0).padStart(2,'0');
break;
case'I'://Hour (12-hour clock) as a decimal number [01,12].
out+=(tm.tm_hour%12).toFixed(0).padStart(2,'0');
break;
case'j'://Day of the year as a decimal number [001,366].
out+=(tm.tm_yday).toFixed(0).padStart(3,'0');
break;
case'm'://Month as a decimal number [01,12].
out+=(tm.tm_mon+1).toFixed(0).padStart(2,'0');
break;
case'M'://Minute as a decimal number [00,59].
out+=(tm.tm_min).toFixed(0).padStart(2,'0');
break;
case'n'://A <newline>.
out+='\n';
break;
case'p'://Locale's equivalent of either AM or PM.
if(tm.tm_hour>11){
out+='PM';
}else{
out+='AM';
}
break;
case'r'://12-hour clock time [01,12] using the AM/PM notation; in the POSIX locale, this shall be equivalent to %I : %M : %S %p.
out+=getDTStr('%I:%M:%S%p',tm);
break;
case's':
out+=time.mktime(tm).toFixed(0);
break;
case'S'://Seconds as a decimal number [00,60].
out+=tm.tm_sec.toFixed(0).padStart(2,'0');
break;
case't'://A <tab>.
out+='\t';
break;
case'T'://24-hour clock time [00,23] in the format HH:MM:SS.
out+=getDTStr('%H:%M:%S',tm);
break;
case'u'://Weekday as a decimal number [1,7] (1=Monday).
if(tm.tm_wday<1){
out+='7';
}else{
out+=tm.tm_wday.toFixed(0);
}
break;
case'U'://Week of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday shall be considered to be in week 0.
// TODO: this
break;
case'V'://Week of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing January 1 has four or more days in the new year, then it shall be considered week 1; otherwise, it shall be the last week of the previous year, and the next week shall be week 1.
// TODO: this
break;
case'w'://Weekday as a decimal number [0,6] (0=Sunday).
out+=tm.tm_wday.toFixed(0);
break;
case'W'://Week of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday shall be considered to be in week 0.
// TODO: this
break;
case'x'://Locale's appropriate date representation.
out+=getDTStr('%d/%m/%Y',tm);
break;
case'X'://Locale's appropriate time representation.
out+=getDTStr('%H:%M:%S',tm);
break;
case'y'://Year within century [00,99].
out+=(tm.tm_year+1900).toFixed(0).substring(2);
break;
case'Y'://Year with century as a decimal number.
out+=(tm.tm_year+1900).toFixed(0);
break;
case'Z'://Timezone name, or no characters if no timezone is determinable.