ReverseChronologicalPager: Fix timezone confusion
(This change is best tested with Special:Log before changes from
38756eae4, since it seems the $mDay/$mMonth/$mYear values are not
directly used anywhere in core after that.)
The setTimezone() call did not actually change the offset used for
database lookup, because getTimestamp() returns a Unix timestamp,
which by definition does not include timezone information.
It did change the offset used for year/month/day fields in the
interface, but it changed it in the wrong direction: instead of
assuming the date is in local timezone and converting to UTC, it
assumed the date is in UTC and converted it to local timezone.
We don't actually want to do anything with timezones here. For better
or worse, the date selectors for pagers have always used UTC dates.
The timezone code was only introduced relatively recently in
53fa809a.
What we really want for the interface is to display the previous
date, relative to the database offset. The interface asks the user
to select the month/date up to which to display things (such as
"May 2018 (and earlier)"), but the database queries use strict
comparison (such as `log_timestamp < '
20180601000000'`), so the
database offset is calculated to the next date after selected one.
The incorrect timezone calculation accidentally did so, but only if
the wiki timezone had a negative offset relative to the UTC. If the
wiki was using UTC or a timezone with positive offset, the correction
was not applied, causing the selected date in the interface to move
one day forward from the date that was set.
Bug: T171110
Change-Id: I8c2cd398d7c7ac68a8f46ee94cb9e7c6beed5694