PHILADELPHIA — Can you imagine a Democratic nominee for president who boasts about increasing American oil and gas production and tries to take credit for it? It sounds like a picture from a distant past. But in 2012, during his reelection campaign, President Obama was bragging about the fracking boom, and the Democratic Party platform touted his all-of-the-above energy policy.

This election cycle is very different. The Democratic primary candidates competed over who would be the toughest on fossil fuels and climate change. Hillary Clinton has called for banning offshore drilling in the Arctic and Atlantic, phasing out fossil fuel production on public land, and imposing stricter fracking regulations. She did not get there on her own: Both Martin O’Malley and Bernie Sanders challenged her from the left on climate change with even more ambitious proposals. The Sanders’ camp also pushed the Democratic platform committee with a number of climate-related demands, resulting in a document that calls for carbon pricing and rejecting future infrastructure projects that would increase U.S. carbon emissions.

The party that gathers in Philadelphia for its national convention this week has been transformed on climate change and energy policy since 2012. The shift is not about Obama versus Clinton as individuals. Obama himself has moved toward stronger climate action in his second term. No one would have predicted in 2011 that he would reject Keystone XL and start reforming coal leasing on federal land.