]> Sergey Matveev's repositories - public-inbox.git/commit
search: fix rt: w/ approxidate when TZ != UTC
authorEric Wong <e@80x24.org>
Fri, 17 Sep 2021 04:40:07 +0000 (13:40 +0900)
committerEric Wong <e@80x24.org>
Fri, 17 Sep 2021 04:41:11 +0000 (04:41 +0000)
commitfe1b11bf5a752743167018f77e2826304ba0aa0e
tree955d2dad4b8ed11794f276f3c7ce5fcebadc8884
parent23ac27869da4744aba2a67454504b7a157583df7
search: fix rt: w/ approxidate when TZ != UTC

While git respects a user's local timezone and returns
seconds-since-the-Epoch, we were unnecessarily and incorrectly
calling gmtime+strftime on its result.  So ignore calling
gmtime+strftime when the strftime format is "%s", just feed
the output time from git directly to Xapian.

This is mainly for lei, which will likely run in a variety of
timezones.  While we're at it, add a recommendation to use
TZ=UTC in public-inbox-httpd, in case there are (misguided :P)
sysadmins who set a non-UTC TZ.
examples/public-inbox-httpd@.service
lib/PublicInbox/Search.pm
t/lei_store.t