Monthly Calendar by macik

#!perl -pa
sub D{$z=pop;(31,28+($z%4<1and$z%100>0|$z%400<1),@E=(31,30)x2,31,@E,31)[pop]}($y,$m)=@F;$d=D--$m,$y;$n=$o=0;for$Y(1804..$y){for(0..11){last if$_==$m&&$y==$Y;$o+=D$_,$Y}}$o%=7;$_=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$m]." $y
";$_.=' '.join(' ',map{sprintf"%2s",$o-->0|$n>=$d?'  ':++$n}0..6).$/while$n<$d;s/\s+$/

/

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

download

return to the top page