1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| #!/usr/bin/perl
use strict;
use warnings;
use Date::Calc qw(Today N_Delta_YMD Delta_Days);
my $start = '2009/10/17';
my ($year1,$month1,$day1) = split /\//, $start;
my ($year2,$month2,$day2) = Today([1]);
my ($Dy,$Dm,$Dd) = N_Delta_YMD($year1,$month1,$day1,$year2,$month2,$day2);
my $Dd_tot = Delta_Days($year1,$month1,$day1,$year2,$month2,$day2);
my $weeks = int($Dd_tot/7);
my $modulo_days = $Dd_tot%7;
print "start : $year1,$month1,$day1
today : $year2,$month2,$day2
$Dm mois,$Dd jour(s)
jours : $Dd_tot jour(s)
semaines : $weeks semaines, $modulo_days jour(s)\n"; |
Partager