$ perl -Mstrict -Mwarnings -E ' use Time::Piece; use Time::Seconds; my @ordinals = qw{1st 2nd 3rd 4th 5th}; my @even_odd = qw{even odd}; my $secs_per_week = 7 * 24 * 60 * 60; my $days_from_now = 15; my $now = localtime; say "Today is: ", $now->strftime; if ($now->fullday eq "Tuesday") { say "It is the $ordinals[$now->mday / 7] Tuesday of the month."; say "It is the ", int($now->epoch / $secs_per_week), "th Tuesday of the epoch."; say "So it is an $even_odd[$now->epoch / $secs_per_week % 2] Tuesday."; } else { say "Not Tuesday: nothing to do."; } my $future = $now + ONE_DAY * $days_from_now; say "$days_from_now days from now will be: ", $future->strftime; say "That is ", $future->wdayname =~ /^(?:Sat|Sun)$/ ? "" : "not ", "a weekend."; ' Today is: Tue, 17 Sep 2013 11:38:22 EST It is the 3rd Tuesday of the month. It is the 2280th Tuesday of the epoch. So it is an even Tuesday. 15 days from now will be: Wed, 02 Oct 2013 11:38:22 EST That is not a weekend.