Files
VSC/Perl/stringToDateCompare.pl
claudio 368d6fafea Issue
Code backup
2026-05-10 16:59:01 +02:00

13 lines
390 B
Perl

#!/usr/bin/perl -w
use strict;
use warnings;
use Time::Piece;
my $bat_expire = "10/14/2023";
if (Time::Piece->strptime($bat_expire, "%m/%d/%Y") > localtime) {
print "Battery replacement is recommended by $bat_expire, according to the UPS estimated life algorithm.\n";
} else {
print "The recommended battery replacement date calculated by the UPS algorithm was $bat_expire.\n";
}