about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-05-29 17:57:34 +0530
committerAndinus <andinus@nand.sh>2020-05-29 17:57:34 +0530
commit11efdb8ac7640e3200bedfd33686c8a09cfb2bc6 (patch)
treeb8085e844de5c8aa1ff3158d132568b574eb10c6
parent21055955d7420ddb17cd5c8bf5e0c8ac70a0e96a (diff)
downloadara-11efdb8ac7640e3200bedfd33686c8a09cfb2bc6.tar.gz
Format date in output to 'Month Date'
-rwxr-xr-xara.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/ara.pl b/ara.pl
index 37011a2..07275c4 100755
--- a/ara.pl
+++ b/ara.pl
@@ -55,6 +55,9 @@ my $json_data = decode_json($file_data);
 # Get statewise information.
 my @statewise = ${$json_data}{'statewise'};
 
+# Map month number to Months.
+my @months = qw( lol Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
+
 my $rows = [
     ['State', 'Confirmed', 'Active', 'Recovered', 'Deaths', 'Last Updated'],
     ];
@@ -71,7 +74,7 @@ foreach my $i (0...37) {
         $statewise[0][$i]{'active'},
         "$statewise[0][$i]{'recovered'} (+$statewise[0][$i]{'deltadeaths'})",
         "$statewise[0][$i]{'deaths'} (+$statewise[0][$i]{'deltarecovered'})",
-        substr( $lastupdatedtime, 0, 5 ),
+        $months[substr( $lastupdatedtime, 3, 5 )] . " " . substr( $lastupdatedtime, 0, 2 ),
         ];
 }