From 7b2d469609654b59b74283b02c8b4549be000ebe Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Mon, 10 Dec 2012 17:46:17 +0100 Subject: [PATCH] Fix date encoding with call to date+iconv or fallback to strftime(). --- SquidAnalyzer.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SquidAnalyzer.pm b/SquidAnalyzer.pm index d9dab78..6018d74 100644 --- a/SquidAnalyzer.pm +++ b/SquidAnalyzer.pm @@ -1094,7 +1094,9 @@ sub _print_header { my ($self, $fileout, $menu, $calendar) = @_; - my $now = strftime("%a %b %e %H:%M:%S %Y", localtime); + my $curdate = `date | iconv -t $Translate{CharSet} 2>/dev/null`; + chomp($curdate); + my $now = $curdate || strftime("%a %b %e %H:%M:%S %Y", localtime); print $$fileout qq{ *.$_ -$domain_stat{$_}{hits} +$domain_stat{$_}{hits} $c_percent $comma_bytes $b_percent -$duration +$duration $d_percent }; print $out qq{