Spoilers for Story! · 11:58pm Dec 24th, 2016
In "The Legends of Equestria: Star Swirl the Bearded"
Here is what happens.
Star Swirl writes the book that Twilight Sparkle reads (how else was the number of stars correct and so exact?)
Timeline: Pre Equestrian History (PREQHIST/ PREQ)
Then there is the Age of Construction, the first ten years after Equestria is formed (AOC)
The Age of Discord (AOD)
The Age of the Sun where Celestial rules alone. (AOS)
Modern (where Nightmare Moon is reformed, canon material)