NEW YORK — The clock read 3:56 p.m., although the players seated in the Yankees clubhouse never bothered to look up. They buried their heads in their iPhones and iPads, scrolled through Twitter timelines and swiped at their touch screens.

“Four minutes,” Yankees reliever Chad Qualls said to nobody in particular, noting the time on his phone.

In a car somewhere in New Jersey, Yankees pitcher Joba Chamberlain noticed that the traffic was surprisingly light on the way to Trenton, where he was to make his final minor-league rehab appearance. Then the clock struck 4 p.m. — the deadline for teams to complete trades — and Chamberlain’s destination had changed.

Yankees general manager Brian Cashman found his desired stopgap at third base, sending Qualls to the Pirates for infielder Casey McGehee, with the deal coming together with a few minutes to spare. Then, Chamberlain got the call to make a U-turn back to the Bronx. After 14 months of rehab, first for Tommy John surgery and then for a freak ankle injury, the Yankees activated the right-hander from the disabled list.

“To be honest with you, I was more nervous now, today, than I was when I got (first) called up,” he said. “It’s nice to have those feelings again.”

The return of Chamberlain concluded an afternoon in which the Yankees upgraded two areas of need: the bench and the bullpen.

In Chamberlain, the Yankees filled a hole in their bullpen with a pitcher capable of neutralizing hitters on both sides of the plate.

And in the 29-year-old McGehee, the Yankees found a right-handed bat capable of playing third base in the absence of Alex Rodriguez, who may be out for seven more weeks. He could also be used to fill in at first base for the next three to five days as Mark Teixeira waits for inflammation in his left wrist to subside.

“He’s one of the guys that obviously fit the bill, but it really formed today,” Cashman said of landing McGehee, who became expendable when the Pirates traded for Gaby Sanchez earlier in the day.

Though published reports in recent weeks linked the Yankees to much more prominent names — such as Phillies pitcher Cliff Lee — Cashman stuck to form by using the deadline to bolster depth.

The Yankees inquired with the Cubs about trading for right-hander Ryan Dempster, according to several people familiar with the talks, who requested anonymity due to the sensitive nature of the talks. Published reports also linked the Yankees to Marlins first baseman Carlos Lee.

Indeed, the Yankees sent two scouts to evaluate Lee, though the clubs fell short of completing a deal. Meanwhile, speculation about Dempster escalated throughout the afternoon.

By 1 p.m., Dempster appeared headed for the Dodgers, though the Yankees had entertained the idea of trading for him. By 3:30 p.m., a deal still looked possible, though unlikely. By 4 p.m., Dempster was a member of the Texas Rangers, and the Yankees hadn’t come close to a trade.

“It never got to crunch time,” said a person with knowledge of the team’s thinking.
The Yankees only rotation addition will be Andy Pettitte, who is expected to return from his broken ankle in September.

“You look at what all the guys have done, we expect Andy to come back here,” manager Joe Girardi said, of trusting the arms in his rotation.

At 4:15 p.m., Chamberlain pulled into the parking lot at Waterfront Park in Trenton, jumped out of his car and made an announcement.

“I am headed back to New York,” he said.

Chamberlain quickly used the rest room, grabbed a bottle of water for the road and headed to the Bronx. Through his Twitter account, he asked fans for advice on how to dodge traffic, instructing his driver to skip the tunnels and take the George Washington Bridge.

Chamberlain appeared in uniform at Yankee Stadium just past 6 p.m. The team made it official with an announcement of the moves at 6:24 p.m, hoping that those moves will be enough for the stretch run.

Said Cashman: “Until you get what you want, which is a World Series trophy, you’re never comfortable.”