Warning! Full SPOILERS ahead for Avengers: Endgame!
Avengers: Endgame, the epic culmination of Marvel’s 22-film Infinity Saga, involves a major narrative time-jump for its characters, resurrecting those who fell in Avengers: Infinity War five years later.
The MCU timeline had generally been lined up with the year that an MCU movie came out. So that’s why the Battle of New York is definitively set in 2012, the year Marvel’s The Avengers was released. Of course, Spider-Man: Homecoming infamously mucked things up when it opened in 2017 by saying the Battle of New York happened eight years earlier, which would have set it in 2009 instead of 2012. And just to make things even more confusing, it turned out that Homecoming was actually set in 2016, the same year as Captain America: Civil War meaning the Avengers would have had to take place in 2008. But Endgame clearly reaffirms that the Battle of Manhattan took place in 2012 so Spider-Man: Homecoming messed up.