lib/PublicInbox/SearchView.pm | 5 ++--- lib/PublicInbox/View.pm | 6 ++++-- diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index a15af55ec17777d8f1951eb187ac66c1cc1068ea..7f790902ca4c74e83b024196eafa3c47320b866c 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -10,7 +10,6 @@ use PublicInbox::Hval; use PublicInbox::View; use PublicInbox::MID qw(mid2path mid_clean); use Email::MIME; -use POSIX qw/strftime/; our $LIM = 50; sub sres_top_html { @@ -69,11 +68,11 @@ my $smsg = PublicInbox::SearchMsg->load_doc($m->get_document); my $s = PublicInbox::Hval->new_oneline($smsg->subject); my $f = $smsg->from_name; $f = PublicInbox::Hval->new_oneline($f)->as_html; - my $d = strftime('%Y-%m-%d %H:%M', gmtime($smsg->ts)); + my $ts = PublicInbox::View::fmt_ts($smsg->ts); my $mid = PublicInbox::Hval->new_msgid($smsg->mid)->as_href; $$res .= qq{$rank. }. $s->as_html . "\n"; - $$res .= "$pfx - by $f @ $d UTC [$pct%]\n\n"; + $$res .= "$pfx - by $f @ $ts UTC [$pct%]\n\n"; } } diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index f34e1f36d00e20a47754c6b732e7234d36a62e43..2506c95417fc267b6e6436ca0e0bf7175922104b 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -712,8 +712,10 @@ sub _msg_date { my ($mime) = @_; my $ts = $mime->header('X-PI-TS') || msg_timestamp($mime); - POSIX::strftime('%Y-%m-%d %H:%M', gmtime($ts)); + fmt_ts($ts); } + +sub fmt_ts { POSIX::strftime('%Y-%m-%d %k:%M', gmtime($_[0])) } sub _inline_header { my ($dst, $state, $upfx, $mime, $level) = @_; @@ -865,7 +867,7 @@ my $dot = $level == 0 ? '' : '` '; $dst .= "$nl$pfx$dot$subj\n"; my $attr; - $ts = POSIX::strftime('%Y-%m-%d %H:%M', gmtime($ts)); + $ts = fmt_ts($ts); if ($n == 1) { $attr = "@ $ts UTC"; $n = "";