Imām Bukhārī narrates: 'Abdullāh ibn Yūsuf narrated to us, he said: Imām Mālik informed us, from Nāfi', from Ibn 'Umar, may Allāh be pleased with them both, that the Messenger of Allāh ﷺ said:
None of you should intend to pray at the time of the rising of the sun and at the time of the setting of the sun.
Reference: Sahih Al Bukhari 585