Maybe Edwin Encarnacion just needed time to get with the program.

Emotionally. Technically.

Then again, perhaps Friday night’s performance will prove to be a temporary revival. Free advice to the gambling community, however: Don’t bet on that.

The Yankees opened their second half with a 4-0 blanking of the Blue Jays on Friday night at Yankee Stadium, with Domingo German picking up where he left off with six shutout innings and Encarnacion not channeling his first 16 games as a Yankee. Instead, the man who scratched out two singles and two doubles in his first 65 pinstriped at-bats contributed a single and a double, the latter clanging off the wall in left-center field and clearing the loaded bases to put this contest out of reach for the rebuilding Jays, Encarnacion’s former team.

To state merely that Encarnacion has not endeared himself to Yankees fans since his June 17 arrival in The Bronx would be an understatement akin to proclaiming that not everyone loved the “How I Met Your Mother” finale. My inbox and Twitter handle feature a steady stream of Encarnacion-related consternation: He’s ruining the DJ LeMahieu-led vibe of prioritizing contact over launch angle! Why did the Yankees demote Clint Frazier for this guy?

Yet unless you believe that the 36-year-old Encarnacion suddenly turned old upon donning the pinstripes, his welcome-back performance here should serve as a most positive indicator.

“It’s just all about timing,” Encarnacion said. “Get my timing right, I’m going to be all right. I don’t worry too much. I know what I can do.”

What he can do came to light in the bottom of the fifth inning, the Yankees having just taken a 1-0 lead on Brett Gardner’s leadoff triple and LeMahieu’s RBI groundout. They then loaded the bases for Encarnacion, who had lined a single in his first at-bat. This time, he smoked a 1-and-0 fastball from his former teammate, Aaron Sanchez, over left fielder Lourdes Gurriel Jr. in an instant, and even the normally slow-footed Gary Sanchez scored from first base, following the paths of Aarons Judge and Hicks, to put the Yankees comfortably ahead.

“I think Gurriel probably thought he had a play on it,” Aaron Boone said. “He hit it so well, it kept carrying on him. So he’s a really good hitter, and he’s a presence in our lineup. And [I] love how he looks in our lineup.”

Let’s face it, though: Encarnacion hadn’t looked very good. He entered the night with a .123/.208/.338 slash line in 72 plate appearances as a Yankee. Boone not surprisingly harped on the one positive in that line: The disparity between the batting average and the on-base percentage, which reflected the veteran’s six walks and one hit by pitch.

“I really feel like, even though he hasn’t gotten a ton of results yet … the at-bats have been there,” Boone said. “You can see, it’s a lot to get through him. You’ve got to execute. He’s missed a few pitches I think that he’s probably been on. He hasn’t swung it as great as he’s going to. But he’s so dangerous.”

To work out of his funk, Encarnacion said: “I do a lot of different repetitions. I work in the cage. Watch video. There’s a lot of different stuff that i do. Working with the hitting coach and seeing what we can see in my swing. But it’s all about my timing. Working in the cage, getting my timing right.”

With the Mariners this season, Encarnacion had a slash line of .241/.356/531. And while he has struck out 23 times in 69 Yankees at-bats, his career rate of whiffs (1,350 in 6,773 at-bats) is considerably lower. This is not 2018 Giancarlo Stanton redux.

“It’s feeling better,” Encarnacion said of his timing. “I’m going to continue to work and do what I need to do.”

He gave the Yankees exactly what they needed on this night. His history says there’ll be more to come.