You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
630 B
Raku

#!/usr/bin/perl
($thisMonth, $thisYear, $thisDay) = split(/:/,`date +%m:%Y:%d`);
($thisMonth, $thisDay, $thisYear ) = MMDDYYYY();
sub MMDDYYYY(){
my @timeList = localtime(time);
my $MM = sprintf("%02d",$timeList[4]+1);
my $YYYY = normalizeYear($timeList[5]);
my $DD = sprintf("%02d",$timeList[3]);
return ($MM,$DD,$YYYY);
}
sub normalizeYear {
local ($yearToNormalize) = @_;
if ($yearToNormalize < 90) {
sprintf "20%.2d",$yearToNormalize;
}elsif ($yearToNormalize < 100) {
sprintf "19%.2d",$yearToNormalize;
}else {
sprintf "%.4d",$yearToNormalize;
}
}
return 1;