Abu al-Zubayr narrates: I asked Sayyiduna Jabir (may Allah be pleased with him): Did you hear the Prophet (peace and blessings be upon him) saying: "A man is counted as being in prayer as long as he is waiting for the prayer"? He replied: Once we waited for the Prophet (peace and blessings be upon him) for the Isha prayer, and he did not come out to us until it was close to midnight, or it had reached midnight. Then the Prophet (peace and blessings be upon him) came and we offered the prayer. Then he said: "Remain seated." Then the Prophet (peace and blessings be upon him) addressed us and said: "The people have prayed and gone to sleep, and you will continue to be counted as in a state of prayer for as long as you have been waiting for the prayer."
Ahmad and Abu Ya'la recorded it, and he added these words: "Then he said: 'Were it not for the weakness of the weak and the old age of the elderly, I would delay this prayer until the middle of the night.'" The narrators of Abu Ya'la's chain are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1746