Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Forked from tadzik/remaining.pl
Last active April 16, 2020 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaniel/531999d23d85404bf51212291c3744bf to your computer and use it in GitHub Desktop.
Save AlexDaniel/531999d23d85404bf51212291c3744bf to your computer and use it in GitHub Desktop.
my $answer;
for ^2000 {
my $date = Date.today;
my $month = $date.month;
my $days_left = 0;
while ($date.month == $month) {
if ($date.day-of-week < 6) {
$days_left++;
}
$date = $date.later(:1day);
}
$answer = "$days_left workdays left in month (including today)";
}
say $answer;
say now - BEGIN now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment