Acme-December-Eternal
view release on metacpan or search on metacpan
lib/Acme/December/Eternal.pm view on Meta::CPAN
$month =~ s/^0+//g;
my $dayofyear = $date->printf('%j');
$dayofyear =~ s/^0+//g;
my $dayofmonth = $date->printf('%d');
$dayofmonth =~ s/^0+//g;
my $year = $date->printf('%Y');
my $weekday = $date->printf('%a');
$weekday .= ', ';
# 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;
if($month == 8) {
# August
$result = $weekday . ordinate($dayofmonth) . ' August ' . $year;
} else {
# December
if($month > 8) {
my $daycount = $dayofyear - $septday + 1;
$result = $weekday . ordinate($daycount) . ' December ' . $year
lib/Acme/December/Eternal.pm view on Meta::CPAN
use Acme::December::Eternal;
print eternaldecemberize('2019-10-18 10:28:00'), "\n";
=head1 DESCRIPTION
This module calculates a nicely formatted string for the "canadian eternal december" for any given date string.
According to stevieb on perlmonks, Canada has only two months per year. August (when it is warm), and the rest is
December (year starts with 1st of August). This module turns normal western dates into something more
useful to my Canadian friend.
=head2 eternalDecemberize()
This function takes a date string (anything that L<Date::Manip> can parse should be OK) and returns it formatted
as something like "Fri, 293th December 2019 10:28:23"
=head1 SEE ALSO
L<https://www.perlmonks.org/?node_id=11107642>
( run in 0.257 second using v1.01-cache-2.11-cpan-0d8aa00de5b )