1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #!/usr/bin/perl
use strict; use warnings;
use DateTime;
use DateTime::Set;
my $days = DateTime::Set->from_recurrence(
after => DateTime->now(locale => 'fr', time_zone => 'Europe/Paris',)
->subtract( months => 1 ),
before => DateTime->now(locale => 'fr', time_zone => 'Europe/Paris',),
recurrence => sub {
return $_[0]->truncate( to => 'day' )->add( days => 1 );
},
);
my $first = $days->next();
print "En premier nous serons le ", $first->strftime("%A %e %B %Y"),"\n";
while( defined(my $day = $days->next()) ) {
print "Puis le ", $day->strftime("%A %e %B %Y"),"\n";
}
__END__ |
Partager