"Now according to the book of Acts the period of time from Peter feeling that he could not eat with the gentiles to the time he realized that the Lord had shown him that is what he wanted to do, to the time he actually baptized them, to the time he met with James to defend these actions was a matter of days, perhaps a week or two. The fact that "all were zealous for the law" indicates that there is a real need to do something. Who better to repent than James? Who better to speak than James? There is no reason to think his repentance and then letter was years in the making. It could have been a month."
Brother
ZNP,
The timeline for the events above were probably closer to 20 years.
Peter saw the vision from the roof of Simon the Tanner's house (which is still there by the way according to a certain tour guide

) and baptized the house of Cornelius up the coast shortly thereafter in the range of AD 39-41...
... and James wrote his epistle in about AD 48-51...
...and then the incident in Acts 21 where "all were zealous for the law" occurred around AD 58
-60