I heard the Messenger of Allah ﷺ say, "Give in charity, for a time will come upon you when a man will walk about with his charity, and the one to whom it is offered will say, 'If you had brought it yesterday, I would have accepted it, but today I have no need of it.'"
أخبرنا محمد بن عبد الأعلى قال حدثنا خالد قال حدثنا شعبة عن معبد بن خالد
سمعت رسول الله ﷺ يقول تصدقوا فإنه سيأتي عليكم زمان يمشي الرجل بصدقته فيقول الذي يعطاها لو جئت بها بالأمس قبلتها فأما اليوم فلا
Bukhari recorded it in Zakat, chapter "Charity before it is refused", hadith 1411, and Muslim in Zakat, chapter "Charity before the time comes when no one is found to accept it", hadith 1011, from the hadith of Shubah, through the same chain. It is also found in Al-Kubra, in the chapter on encouragement, hadith 2336.