The Messenger of Allah ﷺ said, "Seek Laylat al-Qadr in the last ten nights, and if you are unable to do so, then do not let the final seven slip past you."
قال رسول الله ﷺ: اطلبوا ليلة القدر في العشر الأواخر، فإن غلبتم فلا تغلبوا على السبع البواقي.
Narrated by Abdullah bin Ahmad (1111), who said, Suwayd bin Saeed narrated to me, Abdul-Hameed bin Hasan Hilali informed me, from Abu Ishaq, from Hubayra bin Yarim, from Ali, and he mentioned it. Its chain is hasan because of Abdul-Hameed bin Hasan Hilali, for there is disagreement about him, though his hadith is hasan when he does not err, and this is among what he did not err in, Allah willing, due to well-established foundations. Abu Hatim said, "A shaykh," and Ibn Main deemed him trustworthy in one report.On this subject there is also what was narrated from Abu Aqrab, who said, I went early one morning to Ibn Masud during Ramadan, and I found him sitting on top of his house. We heard his voice saying, "Allah has spoken the truth, and His Messenger has conveyed it faithfully." So we said, "We heard you saying, 'Allah has spoken the truth, and His Messenger has conveyed it faithfully.'" He said, the Messenger of Allah ﷺ said, "Laylat al-Qadr falls in the middle of the last seven nights of Ramadan. The sun rises clear that morning, without rays." So I looked at it and found it just as the Messenger of Allah ﷺ had said.This was narrated by Ahmad (3857) from Abu Nadr, who said, Abu Muawiya, meaning Shayban, narrated to us, from Abu Yaqfur, from Abu Salt, from Abu Aqrab, and he mentioned it. Abu Salt and his teacher Abu Aqrab are unknown.