in reply to Github repo with plenty of module examples
Cool idea. I wouldn't recommend that implementation as an example of good Perl style, though:
my $date_1 = new DateTime (year => 2014, month => 7, day => 5); my $date_2 = new DateTime (year => 2014, month => 7, day =>15); # Calculate Δ # delta_tays() returns a DateTime::Duration object printf "date_2 (%s) is %d days away from date_1 (%s)\n", $date_2 -> dmy, $date_1->delta_days($date_2)->delta_days, $date_1 -> dmy; my $today = today DateTime; printf "Tdoay is %s\n", $today->dmy;
|
|---|