Mechanics and causes of day and night:

Your answer is correct.

If the earth did not rotate, either the sun would always shine (daytime) or it would always be night depending on where we are on the earth.

Luckily the earth always rotates around itself within 24 hours.


image