All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
We do not know any evidence from the Book of Allaah or the Sunnah of the Prophet which one was created first [before the other]: the sun or the moon, the day or the night. As regards the Saying of Allaah (which means): {… nor does the night outstrip the day…}[Quran 36:40], Ibn Katheer interpreted it to mean: 'When the night comes, another night would not come until day comes and finishes.' Moreover, Adh-Dhahhak said [regarding the interpretation of the above verse]: 'As soon as the night finishes, the day comes…This means that there is no period between the night and day, and that each one of them comes after the other without interruption.'
Besides, Ash-Shawkaani interpreted the above verse to mean that it does not precede it but it comes after it.
Therefore, the meaning of the Saying of Allaah (which means): {…outstrip…} does not mean that it precedes it and comes before it, it rather means that it comes directly after it. So it does not mean that it is created before it.
Allaah Knows best.