Of course he had a good reliable chinese made 24 hour clock. How else could he know that each day had come and gone?
Looking for logic in the Bible is an exercise in futility. Yeah, Light was supposedly the first thing created; the Sun and stars later. Go figure that one.