use Time::Local; my $time = timelocal(0, 0, 0, 21, 4, 1981); my $wday = (localtime $time)[6];