More than a hundred years. The amount of time we have known about burning carbon is longer than the amount of time, since we began the industrial revolution until we were warned.
co2 warning history, 1800's
https://daily.jstor.org/how-19th-century-scientists-predicted-global-warming/
@kevinrns not that we knew about climate change, that we had the knowledge and tech to solve it is pretty recent.