Diaper cream over night??

Sabrianna

This might be a stupid question but is it ok to put diaper cream on a baby over night? My 4 month old sleeps through the night so I don’t change his diaper.