CC: | jlenz [...] amadeus.com |
Subject: | Arp vs Apr in sub timestamp2unixtime // example ApacheAccessLogActivity.pl |
RRD-Simple-1.44
perl v5.28.1
Linux linux-ev1s 5.1.7-1-default #1 SMP Tue Jun 4 07:56:54 UTC 2019 (55f2451) x86_64 x86_64 x86_64 GNU/Linux
xxxxxxxxxxxxxxxx
In the examples file located at:
https://fastapi.metacpan.org/source/NICOLAW/RRD-Simple-1.44/examples/ApacheAccessLogActivity.pl
You have accidentally spelled the abbreviation for April as "Arp" instead of Apr in your sub timestamp2unixtime:
sub timestamp2unixtime {
my %months = (qw(Jan 0 Feb 1 Mar 2 Arp 3 May 4 Jun 5
Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
if (my ($mday,$mon,$year,$hour,$min,$sec,$offset) =
$_[0] =~ m# \[(..)/(...)/(....):(..):(..):(..) (.....)\] #) {
my @val = split(/\s/,sprintf('%d %d %d %d %d %d',
$sec,$min,$hour,$mday,$months{$mon},($year-1900)));
return timelocal(@val);
}
return undef;
}
Thanks for the example script. But, every April I need to fix it! Regards, Jim