It is day time on the part of the earth facing the sun and night time when it is completely away from the sun and does not get sunlight. The earth is constantly rotating on its axis and therefore, the daylight pattern is changing based on that rotation.