Plants do not turn carbon dioxide into oxygen. The way this happens is a complex process called photosynthesis. Plants convert carbon dioxide into carbohydrate precursors and water as fuel for the plant. This does not require any light.
Oxygen is a byproduct of photosynthesis where the plant uses light
and converts it to potential energy.