This affects at least Special:Log and Special:Contributions.
The setTimezone() call does not actually change the offset used for
database lookup, because getTimestamp() returns a Unix timestamp,
which by definition does not include timezone information.
We don't actually want to do anything with timezones here. Whether
we like it or not, these date selectors have always used UTC dates.
Follow-up to I8c2cd398d7c7ac68a8f46ee94cb9e7c6beed5694.
Change-Id: Ia034017af5b37da3aa4889d5b7680c8be423126e
try {
if ( $startStamp !== '' ) {
$startTimestamp = MWTimestamp::getInstance( $startStamp );
- $startTimestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) );
$startOffset = $this->mDb->timestamp( $startTimestamp->getTimestamp() );
$this->rangeConds[] = $this->mIndexField . '>=' . $this->mDb->addQuotes( $startOffset );
}
if ( $endStamp !== '' ) {
$endTimestamp = MWTimestamp::getInstance( $endStamp );
- $endTimestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) );
$endOffset = $this->mDb->timestamp( $endTimestamp->getTimestamp() );
$this->rangeConds[] = $this->mIndexField . '<=' . $this->mDb->addQuotes( $endOffset );
$dateString = $this->getRequest()->getVal( 'wpdate' );
if ( !empty( $dateString ) ) {
$dateStamp = MWTimestamp::getInstance( $dateString . ' 00:00:00' );
- $dateStamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) );
-
$opts->setValue( 'year', (int)$dateStamp->format( 'Y' ) );
$opts->setValue( 'month', (int)$dateStamp->format( 'm' ) );
$opts->setValue( 'day', (int)$dateStamp->format( 'd' ) );