21 use Wikimedia\Timestamp\TimestampException;
47 $this->rangeConds = [];
50 if ( $startStamp !==
'' ) {
52 $startOffset = $this->mDb->timestamp( $startTimestamp->getTimestamp() );
53 $this->rangeConds[] = $this->mIndexField .
'>=' . $this->mDb->addQuotes( $startOffset );
56 if ( $endStamp !==
'' ) {
58 $endOffset = $this->mDb->timestamp( $endTimestamp->getTimestamp() );
59 $this->rangeConds[] = $this->mIndexField .
'<=' . $this->mDb->addQuotes( $endOffset );
62 $this->mYear = (int)$endTimestamp->format(
'Y' );
63 $this->mMonth = (int)$endTimestamp->format(
'm' );
64 $this->mDay = (int)$endTimestamp->format(
'd' );
65 $this->mOffset = $endOffset;
67 }
catch ( TimestampException $ex ) {
92 $legacyTimestamp->timestamp = $legacyTimestamp->timestamp->modify(
'-1 second' );
108 list( $tables, $fields, $conds, $fname, $options, $join_conds ) = parent::buildQueryInfo(
114 if ( $this->rangeConds ) {
115 $conds = array_merge( $conds, $this->rangeConds );
118 return [ $tables, $fields, $conds, $fname, $options, $join_conds ];
static getInstance( $ts=false)
Get a timestamp instance in GMT.