It took 37 minutes of sitting outside in 18-degree weather on Monday before Senator Bernie Sanders of Vermont unfurled one of the blue blankets that had been laid out for guests at Mayor Bill de Blasio’s second inauguration and spread it over his legs.

A personal space heater sat in front of former Mayor David N. Dinkins, who turned 90 in July, and Mr. de Blasio drew some of his biggest applause when he jokingly gave the crowd the choice of a brief speech.

“You are the most distinguished frozen group of people I have ever spoken before,” said Mr. de Blasio, whose speech lasted about 13 minutes.

Mr. de Blasio is the first Democrat in 32 years to win re-election, and one of the hallmark achievements of his tenure has been the city’s plunging homicide rate, which he cited in his speech. But the frigid temperatures stole the show as Mr. de Blasio took the oath of office before several hundred guests — including dozens of people stationed beneath heat lamps spread throughout City Hall plaza.