The time that smog takes to form depends directly on the temperature. Temperature inversions are situations when warm air does not rise instead stays near the ground. During situations of temperature inversions if the wind is calm, smog may get trapped and remain over a place for days.