Buster Posey knew he was due for season-ending hip surgery soon. Now, he knows just how soon.

The Giants catcher told reporters following Friday's extra-innings loss to the Texas Rangers that he will undergo surgery on his ailing right hip Monday in Vail, Colorado. Senior director of athletic training Dave Groeschner told Posey that the surgery has a recovery time of six-to-eight months.

"I think [the surgery] goes smoothly -- hopefully with no hiccups -- I'll be ready to go next Opening Day," Posey said.

Dr. Marc Philippon will perform the surgery, which will repair Posey's labrum and remove bone spurs, according the catcher. He said the decision was made "a few days" ago, and San Francisco's standings position played a role in the timing.

"You don't want to say you're out of it until you're out of it, but unfortunately where are, I think it makes the most sense to get this taken care of now," Posey said.

The Giants ended Friday nine games back of first place in the NL West, as well as the second Wild Card spot.

Posey has dealt with hip discomfort all season. He skipped the All-Star Game in Washington in order to receive a cortisone injection in his right hip, but as Giants Insider Alex Pavlovic noted Tuesday, that hasn't led to better numbers.

The 31-year-old is slashing .284/.357/.382 in 2018, and all three marks are the worst of any big-league season in which he's played at least 100 games. His five homers are also a career-low, and the former MVP hasn't gone yard in just over two months.

Posey said he is hopeful that surgery will allow him to rediscover his previous form.

"Everything that I've researched and heard is that the outcome is generally pretty good," he said. "It can get you back to getting that range in your hip that's pretty vital for hitting and squatting."

Posey told reporters that he is not sure if he will play on Saturday, his last chance to do so before flying out Sunday ahead of his surgery.