The mayors of the two greatest cities in the world, New York and London, combined on Jan. 6 to endorse folly. New York’s Bill DeBlasio and London’s Sadiq Khan issued a combined call for all cities to follow their example and divest pension funds in fossil fuel companies.

The plan is to force an end the burning of fossil fuels by pulling their pension funds out of fossil fuel company investments. In another context, this was known as a starve-the-beast strategy.

In reality it was cheap politics: an example of what the British like to refer to as “signaling virtue.”

Putting pressure on the oil and gas companies that are the targets of their worships somehow is meant to force them to do what? To pack up, shutdown and “say ‘uncle’!”, leaving us without gasoline for cars, diesel for trucks or natural gas for electric generation, to say nothing of heating our homes and making meals?

The big woolly idea behind this and much of the Green New Deal, on which the mayors based their pronouncements, is that by punishing the oil and gas companies, they speed the arrival of carbon-free electricity and transportation.

Their worships should work on congestion, affordable housing, homelessness and the other innumerable ills that plague cities, not the least New York and London.

As for DeBlasio, he could do something efficacious for cleaning the air. He could fight to save the Indian Point nuclear plant up the Hudson River, which has provided more than 20 percent of New York City’s electric power for decades with nary a smidgen of carbon being produced. Now it is to close and not a squeak from the clean-air mayor. Also, he could have spoken for other regional nuclear plants that have been closed in an untimely fashion.

Like many supporters of the Green New Deal, the two mayors are correctly worried about global warming. Their low-lying cities with tidal rivers are likely to suffer irreversible flooding within the decade. But they are closed-minded about the measures that can be taken to reverse global warming. They want clean electricity, but only if it is made in ways that are approved by the left of their parties — the Democrats for DeBlasio and Labor for Khan. They want only politically correct, clean air.

The mayors want electricity that is produced from the wind or the sun. In their dreams, to misquote Annie Oakley in the musical, they have the sun in the morning and the wind at night. If only. The wind blows irregularly and the sun, well we know when that shines.

Politicians are out of their depths and dangerous when they prescribe a solution, not a destination. If a government, say that of the City of New York, declares it wants more and more of the electricity generated in the city to be carbon-free, it should stick to that goal. It should not tell the market — and the industry — which kinds of carbon-free electricity meet the goal.

The goal should be the aim, not the plays that will get the ball there.

Nuclear plants in the United States are failing because after deregulation of the electric utility industry in the 1990s, a market was established in which the lowest-priced electricity was always to be favored — neither social value nor consideration for the fact that this would favor a carbon fuel, natural gas, over highly regulated nuclear plants was considered.

The mayors did not mention — as those who decide that the fossil companies are to blame are wont to do — that there are technologies on the horizon to capture carbon before it gets into the air. This is known as carbon capture use and storage.

Oddly a rah-rah, American Petroleum Institute event, which API does every January in Washington, staged after the mayors’ announcement, under the rubric of “America’s Energy Future,” also failed to mention carbon capture use and storage, although oil companies are leaders in the field. Instead, API dwelled on the virtues of oil and gas in everything thing from job growth to entrepreneurship to quality of life.

Science brought us the fracking boom, cheap solar cells, efficient windmills and it should be given a chance to solve the carbon problem, both with clean nuclear and with much cleaner fossil. The rest is posturing, even as we have just finished the hottest decade on history.

The worshipful mayors of New York and London should be panicked about saving their cities, not signaling their liberal credentials.