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:17:12

And We have made the night and day two signs, and We erased the sign of the night and made the sign of the day visible that you may seek bounty from your Lord and may know the number of years and the account ˹of time˺. And everything We have set out in detail.  

And We made the night and the day two signs, ˹both˺ indicators of Our power. Then We effaced the sign of the night, extinguishing its light with darkness, so that you might repose therein (the annexation ˹āyata’layli, ‘the sign of the night’, is explicative), and made the sign of the day sight-giving, in other words, one in which it is possible to see because of the light; that you may seek, therein, bounty from your Lord, by earning ˹your livelihood˺, and that you may know, by both ˹day and night˺, the number of years and the reckoning, of the times ˹of the day˺, and everything, that might be needed, We have detailed very distinctly, We have explained clearly.
القرآن:١٧:١٢

وَجَعَلْنَا اللَّيْلَ وَالنَّهَارَ آيَتَيْنِ ۖ فَمَحَوْنَا آيَةَ اللَّيْلِ وَجَعَلْنَا آيَةَ النَّهَارِ مُبْصِرَةً لِتَبْتَغُوا فَضْلًا مِنْ رَبِّكُمْ وَلِتَعْلَمُوا عَدَدَ السِّنِينَ وَالْحِسَابَ ۚ وَكُلَّ شَيْءٍ فَصَّلْنَاهُ تَفْصِيلًا  

{وجعلنا الليل والنهار آيتين} دالتين على قدرتنا {فمحونا آية الليل} طمسنا نورها بالظلام لتسكنوا فيه والإضافة للبيان {وجعلنا آية النهار مبصرة} أي مبصرا فيها بالضوء {لتبتغوا} فيه {فضلاً من ربكم} بالكسب {ولتعلموا} بهما {عدد السنين والحساب} للأوقات {وكل شيء} يحتاج إليه {فصلناه تفصيلاً} بيناه تبيينا.