Trying to determine when God created the angels is somewhat tricky because anything God did "before the foundation of the world" puts the event outside of time itself. Time and space are characteristics of our world, not God's. He is not limited by hours, days, and years as we are. In fact, the Bible tells us that "But, beloved, be not ignorant of this one thing, that one day is with the Lord as a thousand years, and a thousand years as one day." 2 Peter 3:8
We do know that God created the angels before He created the physical universe. The book of Job describes the angels worshipping God as He was creating the world:
"Where wast thou when I laid the foundations of the earth? declare, if thou hast understanding. Who hath laid the measures thereof, if thou knowest? or who hath stretched the line upon it? Whereupon are the foundations thereof fastened? or who laid the corner stone thereof; When the morning stars sang together, and all the sons of God shouted for joy?" Job 38:4-7
The foundations of the world are all the things God created to sustain life on the earth before He put life on it; oxygen, the rotation of the earth, the magnetic reversals of the poles, the axis of the earth, the amount of lightning strikes on the earth that put nitrogen into the ground so things could grow, gravity, rain, water in general, the ocean, the firmament of the land and the sea, which is why the sea stops at the shores, photosynthesis, etc. There are 122 of these, which are referred to as anthropic constants.
The morning stars are Angels who witnessed all the creation first hand. If we consider the function of angels, we might conclude that God created the angels just prior to the creation of mankind because one of their duties is to be “Are they not all ministering spirits, sent forth to minister for them who shall be heirs of salvation?"Hebrews 1:14. We also know they existed prior to the garden of Eden, because Satan, who was formerly the angel Lucifer, was already present in the garden in his fallen state. However, because another function of angels is to worship God around His throne (Revelation 5:11-14), they may have been in existence millions of years—as we reckon time—before God created the world, worshipping and serving Him.
Although the Bible does not specifically say when God created the angels, it was sometime before the world was created. Whether this was a day before, or billions of years before—again, as we reckon time—we have no idea to be sure.