Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    use strict;
    ...
    }
    
    print $outstring, "\n";
    
  2. or download this
    #!/usr/bin/env perl
    
    use strict;
    ...
    
    my $date = Date::Manip::Date->new();
    $date->parse('2019-07-31');
    
  3. 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');
    
  4. 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;
    
  5. or download this
    my $outstring = '';
    if($month == 8) {
        # August
        $outstring = ordinate($dayofmonth) . ' August ' . $year;
    
  6. or download this
    } else {
        # December
        if($month > 8) {
            my $daycount = $dayofyear - $septday + 1;
            $outstring = ordinate($daycount) . ' December ' . $year
    
  7. 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
        }
    }
    
  8. or download this
    print $outstring, "\n";