- or download this
#!/usr/bin/env perl
use strict;
...
}
print $outstring, "\n";
- or download this
#!/usr/bin/env perl
use strict;
...
my $date = Date::Manip::Date->new();
$date->parse('2019-07-31');
- or download this
my $month = $date->printf('%m');
$month =~ s/^0+//g;
my $dayofyear = $date->printf('%j');
...
my $dayofmonth = $date->printf('%d');
$dayofmonth =~ s/^0+//g;
my $year = $date->printf('%Y');
- or download this
# December starts on 1st of September...
my $septstart = Date::Manip::Date->new();
$septstart->parse($year . '-09-01');
my $septday = $septstart->printf('%j');
$septday =~ s/^0+//g;
- or download this
my $outstring = '';
if($month == 8) {
# August
$outstring = ordinate($dayofmonth) . ' August ' . $year;
- or download this
} else {
# December
if($month > 8) {
my $daycount = $dayofyear - $septday + 1;
$outstring = ordinate($daycount) . ' December ' . $year
- or download this
} else {
# Uh-oh, this is the continuation of last years december...
my $decend = Date::Manip::Date->new();
...
$outstring = ordinate($daycount) . ' December ' . $year
}
}
- or download this
print $outstring, "\n";