Dear student
No, the statement is not true for all plants.
Mostly plants give out oxygen during day and carbon dioxide during night but there are certain exceptions like Peepal tree which gives out oxygen during night. Plants which grow in dry conditions like pineapple, take carbon dioxide during night through stomata in order to conserve water.
Regards