I heard the Messenger of Allah ﷺ say, "Give in charity, for a time is coming when a man will walk about with his charity and the one to whom he offers it will say, 'Had you brought it to us yesterday, I would have accepted it, but now I have no need for it,' and he will find no one to accept it."
سمعت رسول الله ﷺ يقول: تصدقوا، فيوشك الرجل يمشي بصدقته فيقول الذي أعطيها: لو جئتنا بها بالأمس قبلتها، فأما الآن فلا حاجة لي بها، فلا يجد من يقبلها.
Bukhari related it in the Book of Zakat (1411), and Muslim in the Book of Zakat (1011), both through the route of Shubah, from Mabad bin Khalid, who said, "I heard Haritha bin Wahb say" (then he mentioned the hadith). The wording given here is Muslim's.