from, new DateTimeZone( get_option( 'timezone_string' ) ) ); $to = new DateTime( $this->to, new DateTimeZone( get_option( 'timezone_string' ) ) ); $to->modify( '+1 day' ); $where .= " AND post_date BETWEEN '" . $from->format( $format ) . "' AND '" . $to->format( $format ) . "'"; return $where; } public function relative( $where = '', $format = 'Y-m-d' ) { $datetimezone = new DateTimeZone( get_option( 'timezone_string' ) ); $from = new DateTime( 'now', $datetimezone ); $to = new DateTime( 'now', $datetimezone ); $from->modify( '-' . abs( (int) $this->past ) . ' day' ); $to->modify( '+' . abs( (int) $this->future ) . ' day' ); $to->modify( '+1 day' ); $where .= " AND post_date BETWEEN '" . $from->format( $format ) . "' AND '" . $to->format( $format ) . "'"; return $where; } }