If you mean day and night on earth, then the answer is that both came into existence simultaneously. The earth formed from debris orbiting the sun. The very moment the object, which we now call earth, formed, there must have been both day and night, because the sun couldn't have illuminated all sides of the object at the same time.