Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I wanted to ask you if there is a way to calculate the difference in days between 3 or more dates, at once. I know that for two days you would do:
use strict; use warnings; use Date::Calc qw(:all); my $date_first = '2005-09-27'; my $date_second = '2019-12-22'; my @array_first = split(/-/, $date_first); my @array_second = split(/-/, $date_second); my $dd = Delta_Days(@array_first,@array_second); print "$dd\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calculate difference between multiple days
by choroba (Cardinal) on Oct 24, 2018 at 15:27 UTC | |
|
Re: Calculate difference between multiple days
by hippo (Archbishop) on Oct 24, 2018 at 15:35 UTC | |
|
Re: Calculate difference between multiple days
by Discipulus (Canon) on Oct 24, 2018 at 15:45 UTC | |
by Anonymous Monk on Oct 25, 2018 at 09:59 UTC | |
by hippo (Archbishop) on Oct 25, 2018 at 10:10 UTC |