in reply to Calculate difference between multiple days
Assuming you want days between date 1 and date 2 and between date 2 and date 3 etc. then it's a simple enough loop:
#!/usr/bin/env perl use strict; use warnings; use Date::Calc 'Delta_Days'; my @dates = ('2005-09-27', '2019-12-22', '2018-10-24', '1999-12-31'); my @start = split (/-/, shift @dates); while (0 < @dates) { local $" = '-'; my @end = split (/-/, shift @dates); print "@start to @end is " . Delta_Days (@start, @end) . " days\n" +; @start = @end; }
|
|---|