aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Russell <ac.russell@live.com>2019-12-22 22:06:05 -0500
committerAdam Russell <ac.russell@live.com>2019-12-22 22:06:05 -0500
commitcb51051651bbd1532ddbf211c0200efd6ac8770c (patch)
tree4adc6e745b1cb10ee57ca74c7ef58a31bdac9666
parent49fbaae14e9b50add7d98f122df8bda5acb53e1d (diff)
downloadperlweeklychallenge-club-cb51051651bbd1532ddbf211c0200efd6ac8770c.tar.gz
perlweeklychallenge-club-cb51051651bbd1532ddbf211c0200efd6ac8770c.tar.bz2
perlweeklychallenge-club-cb51051651bbd1532ddbf211c0200efd6ac8770c.zip
updated ch-1.pl
-rw-r--r--challenge-039/adam-russell/perl/ch-1.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-039/adam-russell/perl/ch-1.pl b/challenge-039/adam-russell/perl/ch-1.pl
index 645fbd42de..027500c438 100644
--- a/challenge-039/adam-russell/perl/ch-1.pl
+++ b/challenge-039/adam-russell/perl/ch-1.pl
@@ -45,7 +45,7 @@ while(my $line = <DATA>){
){
$lights_on -> add_duration($out->subtract_datetime($start_time));
}
- $start_time = $out;
+ $start_time = $out if (DateTime->compare($start_time, $out) < 0);
}
print $lights_on->hours() . " hours ";
print $lights_on->minutes() . " minutes\n";