Abdullah bin Amr bin As reported,

I heard the Messenger of Allah ﷺ say, "Allah recorded the measurements of all creation fifty thousand years before He created the heavens and the earth." He added, "And His Throne was upon the water."

Azami 1011

Sahih

عن عبد الله بن عمرو، قال

سمعت رسول الله ﷺ يقول: كتب الله مقادير الخلائق قبل أن يخلق السماوات والأرض بخمسين ألف سنة، قال: وكان عرشه على الماء.

الأعظمي 1011صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
Writing the measures of creation before the creation of the heavens and the earth
Numbering
Jami al-Kamil 1011 (2nd edition)
Azami 1011