# formatted dates
function today(fmt, year, month, day, date, str) {
if (0 < year + 0 && year + 0 < 10000 &&
0 < month + 0 && month + 0 <= 12 &&
0 < day + 0 && day + 0 <= 31) {
str = "-d \"" month "/" day "/" year "\"" }
"date +\"" fmt "\" " str | getline date
return date }
IyBmb3JtYXR0ZWQgZGF0ZXMKCmZ1bmN0aW9uIHRvZGF5KGZtdCwgICAgeWVhciwgbW9udGgsIGRheSwgICAgZGF0ZSwgc3RyKSB7CiAgICBpZiAoMCA8IHllYXIgKyAwICYmIHllYXIgKyAwIDwgMTAwMDAgJiYKICAgICAgICAwIDwgbW9udGggKyAwICYmIG1vbnRoICsgMCA8PSAxMiAmJgogICAgICAgIDAgPCBkYXkgKyAwICYmIGRheSArIDAgPD0gMzEpIHsKICAgICAgICAgICAgc3RyID0gIi1kIFwiIiBtb250aCAiLyIgZGF5ICIvIiB5ZWFyICJcIiIgfQogICAgImRhdGUgK1wiIiBmbXQgIlwiICIgc3RyIHwgZ2V0bGluZSBkYXRlCiAgICByZXR1cm4gZGF0ZSB9