Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:10:5

It is He who made the sun a shining light and the moon a derived light and determined for it phases - that you may know the number of years and account ˹of time˺. Allah has not created this except in truth. He details the signs for a people who know  

He it is Who made the sun a radiance, that is, emitting light, and the moon a light, and determined it, with respect to its movement, in stations: 28 stations in 28 nights every month, becoming concealed for two nights when a particular month has 30 days, or ˹concealed˺ for one night, when it has 29 days, so that you might know, thereby, the number of the years and the reckoning. God did not create that, which is mentioned, save in truth, not in vain, exalted be He above such things. He details (read yufassilu or nufassilu, ‘We detail’) the signs for a people who know, who reflect.
القرآن:١٠:٥

هُوَ الَّذِي جَعَلَ الشَّمْسَ ضِيَاءً وَالْقَمَرَ نُورًا وَقَدَّرَهُ مَنَازِلَ لِتَعْلَمُوا عَدَدَ السِّنِينَ وَالْحِسَابَ ۚ مَا خَلَقَ اللَّهُ ذَٰلِكَ إِلَّا بِالْحَقِّ ۚ يُفَصِّلُ الْآيَاتِ لِقَوْمٍ يَعْلَمُونَ  

{هو الذي جعل الشمس ضياءً} ذات ضياء، أي نور {والقمر نورا وقدره} من حيث سيره {منازل} ثمانية وعشرين منزلا في ثمان وعشرين ليلة من كل شهر، ويستتر ليلتين إن كان الشهر ثلاثين يوما، أو ليلة إن كان تسعة وعشرين يوما {لتعلموا} بذلك {عدد السنين والحساب ما خلق الله ذلك} المذكور {إلا بالحق} لا عبثا تعالى عن ذلك {يفصل} بالياء والنون يبين {الآيات لقوم يعلمون} يتدبرون.