cal by nn

m=$1{y=$2
split(/8$/?6:/00$/?623614 625035:45056,a,_)
d=a[/8$/?1:/99/?2:/02/?3:/03/?4:m]
$0="January February March April May June July August September October November December"
S="      "
o=substr(S$m" "y S,length($m)/2,20)"\nSu Mo Tu We Th Fr Sa"
i=0
for(j=FS;i<d||j++<31-4460832/4^m%4;o=o(j>9?j:" "j))o=o(i++%7?FS:RS)}$0=i<36?o RS:o

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page