diff --git a/default/web_tt2/viewlogs.tt2 b/default/web_tt2/viewlogs.tt2
index 2e3237f7500dc527ac5cbc8241c1c79c4138b143..ca597cfd1ad39a75db08abafa444ecc98524bc43 100644
--- a/default/web_tt2/viewlogs.tt2
+++ b/default/web_tt2/viewlogs.tt2
@@ -80,7 +80,11 @@
[%# Reset button will be inserted here. ~%]
-[%|loc%]Search period: [%END%][%|locdt(date_from_formated)%]%d %b %Y %H:%M:%S[%END%] [%|loc%]to[%END%] [%|locdt(date_to_formated)%]%d %b %Y %H:%M:%S[%END%]
+[%|loc%]Search period: [%END%]
+ [% date_from_formated | optdesc('unixtime') %]
+ [%|loc%]to[%END%]
+ [% date_to_formated | optdesc('unixtime') %]
+
[% IF total_results %]
[%|loc(list)%]Research was carried out in list %1.[%END%]
diff --git a/src/cgi/wwsympa.fcgi.in b/src/cgi/wwsympa.fcgi.in
index e2056dc171ae0b6224ec3414ecc1fdeaee1f2281..5d0cb88a99bd8f021678dd3e8e467ec059d58477 100644
--- a/src/cgi/wwsympa.fcgi.in
+++ b/src/cgi/wwsympa.fcgi.in
@@ -16196,11 +16196,9 @@ sub do_viewlogs {
$param->{'total_results'} = 0;
- my @date = $log->get_log_date();
- $param->{'date_from_formated'} =
- $language->gettext_strftime("%Y-%m-%d-%H-%M-%S", localtime($date[0]));
- $param->{'date_to_formated'} =
- $language->gettext_strftime("%Y-%m-%d-%H-%M-%S", localtime($date[1]));
+ my @dates = $log->get_log_date;
+ ($param->{'date_from_formated'}, $param->{'date_to_formated'}) = @dates
+ if @dates;
# Display and search parameters preparation.
my $select = {
diff --git a/src/lib/Sympa/Upgrade.pm b/src/lib/Sympa/Upgrade.pm
index 27bcefef343999a538c34e4801c127bf823858fc..ad2e2f69b036c457767bbbec7bcf2344c0c07d9f 100644
--- a/src/lib/Sympa/Upgrade.pm
+++ b/src/lib/Sympa/Upgrade.pm
@@ -32,7 +32,6 @@ use warnings;
use Encode qw();
use English qw(-no_match_vars);
use MIME::Base64 qw();
-use POSIX qw();
use Time::Local qw();
use Sympa;
@@ -934,7 +933,7 @@ sub upgrade {
my $fh;
my %migrated = ();
my @newconf = ();
- my $date;
+ my ($date, $human_date);
## Some sympa.conf parameters were overridden by wwsympa.conf.
## Others prefer sympa.conf.
@@ -978,8 +977,9 @@ sub upgrade {
## Set language of new file content
$language->push_lang($Conf::Conf{'lang'});
- $date =
- $language->gettext_strftime("%d.%b.%Y-%H.%M.%S", localtime time);
+ $date = time;
+ $human_date = $language->gettext_strftime('%d %b %Y at %H:%M:%S',
+ localtime $date);
if (-r $wwsympa_conf) {
## load only sympa.conf
@@ -1077,7 +1077,7 @@ sub upgrade {
. ('#' x 76) . "\n" . '#### '
. $language->gettext("Migration from wwsympa.conf") . "\n"
. '#### '
- . $date . "\n"
+ . $human_date . "\n"
. ('#' x 76) . "\n\n";
foreach my $type (qw(duplicate add obsolete unknown)) {
@@ -1989,8 +1989,8 @@ sub to_utf8 {
next unless $modified;
- my $date = POSIX::strftime("%Y.%m.%d-%H.%M.%S", localtime(time));
- unless (rename $file, $file . '@' . $date) {
+ my $date = time;
+ unless (rename $file, $file . '.' . $date) {
$log->syslog('err', "Cannot rename old template %s", $file);
next;
}
@@ -2013,7 +2013,7 @@ sub to_utf8 {
next;
}
$log->syslog('notice', 'Modified file %s; original file kept as %s',
- $file, $file . '@' . $date);
+ $file, $file . '.' . $date);
$total++;
}
@@ -2099,8 +2099,7 @@ sub fix_colors {
$new_conf .= "$line\n";
}
# Save previous config file
- my $date =
- $language->gettext_strftime("%d.%b.%Y-%H.%M.%S", localtime time);
+ my $date = time;
unless (rename($file, "$file.upgrade$date")) {
$log->syslog(
'err',
@@ -2143,8 +2142,7 @@ sub save_web_tt2 {
);
return 0;
}
- my $date =
- $language->gettext_strftime("%d.%b.%Y-%H.%M.%S", localtime time);
+ my $date = time;
unless (rename($dir, "$dir.upgrade$date")) {
$log->syslog(
'err',
diff --git a/src/sbin/sympa_wizard.pl.in b/src/sbin/sympa_wizard.pl.in
index 629ac229dea9f995e8cb4c3c325295b5a331836a..f31fba8dbb2b68e4bb6424485bb69fab2cf0f87e 100644
--- a/src/sbin/sympa_wizard.pl.in
+++ b/src/sbin/sympa_wizard.pl.in
@@ -89,7 +89,6 @@ if ($modfail) {
? Sympa::Tools::Text::pad($language->gettext($_[0]), $_[1])
: $language->gettext($_[0]);
};
- *gettext_strftime = sub { $language->gettext_strftime(@_) };
my $lang = $ENV{'LANGUAGE'} || $ENV{'LC_ALL'} || $ENV{'LANG'};
$lang =~ s/\..*// if $lang;
@@ -400,7 +399,9 @@ sub edit_configuration {
}
if ($somechange) {
- my $date = gettext_strftime("%d.%b.%Y-%H.%M.%S", localtime(time));
+ my @time = localtime time;
+ my $date = sprintf '%d%02d%02d%02d%02d%02d',
+ $time[5] + 1900, $time[4] + 1, @time[3, 2, 1, 0];
## Keep old config file
unless (rename $sympa_conf, $sympa_conf . '.' . $date) {