1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #!/usr/bin/perl
use strict; use warnings;
use Time::Local;
my $now = time();
my (undef,undef,undef,undef,$now_month,$now_year) = localtime();
my $next_release;
if( $now_month < 4 ) {
$next_release = timelocal( 0,0,0,1,4,$now_year );
}
elsif ( $now_month > 9 ) {
$next_release = timelocal( 0,0,0,1,4,$now_year+1 );
}
else {
$next_release = timelocal( 0,0,0,1,10,$now_year );
}
my $days_until_next = int( ($next_release - $now) / (60*60*24) ) + 1;
print "Nombre de jours avant la prochaine sortie d'OpenBSD : ", $days_until_next, "\n"; |
Partager