Sagan, the Tinkoff-Saxo rider who also won the fourth stage, completed the 6.6-mile course that began and ended at
Dutchman Jos Van Eden of LottoNL-Jumbo was second, 15 seconds back. France's Julian Alaphilippe of Etixx-Quick Step finished third, 19 seconds behind Sagan.
Sagan took a 28-second lead over former Latvia's Tom Skujins of Hancapie Racing snd became the third race leader with two stages left. Alaphilippe was third overall, 45 seconds back.
The stage was moved from Big Bear Lake's 15.1-mile course because of snow.
"The course was only about 10 kilometers, so it was better for me," said Sagan, who has 13 career stage victories in the event. "My goal wasn't the win but the yellow jersey (overall lead). I took both."
Skujins finished 34th in the time trial, 46 seconds behind Sagan.
"We'll see how it goes," Skujins said. "It doesn't really matter if Sagan has the (yellow) jersey. He'll probably get dropped. But in the end it will come down to those last four miles and then you will see who's there and who's not."
Sagan is not expected to retain his race lead in the mountainous seventh stage, but he didn't concede the race, either.
"I have won some prologues (short time trials), but the (15 miles) is a little long for me," said Sagan. "Maybe they will change the course tomorrow, too."
The event continues Saturday with the 80-mile road race from Ontario to Mount Baldy. The second and final mountain stage of the race's 10th edition, will feature three climbs, including the final 3.4-mile effort to the ski resort with an elevation of 10,064 feet.
"It's only one day, so I will try," Sagan said.