The Messenger of Allah ﷺ commanded us to pay the zakat al-fitr before the people went out to the prayer. Ibn Umar used to pay it a day or two before that.
حدثنا عبد الله بن محمد النفيلي حدثنا زهير حدثنا موسى بن عقبة عن نافع
أمرنا رسول الله ﷺ بزكاة الفطر أن تؤدى قبل خروج الناس إلى الصلاة قال فكان ابن عمر يؤديها قبل ذلك باليوم واليومين
Muslim, Zakat, chapter on the command to pay Zakat al-Fitr before the prayer, no. 986, from the hadith of Zuhayr bin Muawiya, and Bukhari, Zakat, chapter on charity before Eid, no. 1509, from the hadith of Musa bin Uqba, with the same chain.