Imam Malik bin Anas (may Allah have mercy on him) said: The Battle of Badr took place a year and a half after he (peace and blessings be upon him) came to Madinah upon emigrating, the Battle of Uhud a year after that, Khandaq four years after, Banu al-Mustaliq five years after, the Battle of Khaybar in the sixth year, Hudaybiyah in that same year, the Conquest of Makkah in the eighth year, and the Battle of Banu Qurayzah took place in the year of Khandaq.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحجر / 11305