Fixed FormatTime to properly fill in leading zeros when hours are less
authorAndrew DeFaria <Andrew@DeFaria.com>
Mon, 13 Jun 2016 19:15:42 +0000 (12:15 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Mon, 13 Jun 2016 19:15:42 +0000 (12:15 -0700)
than 12

lib/DateUtils.pm

index ef11a89..f106394 100644 (file)
@@ -711,6 +711,8 @@ Returns:
   my $AmPm    = $hours > 12 ? "Pm" : "Am";
 
   $hours = $hours - 12 if $hours > 12;
+  
+  $hours = "0$hours" if length $hours == 1;
 
   return "$hours:$minutes $AmPm";
 } # FormatTime