Question: "When did God create the angels?"
Answer: 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 "with the Lord a day is like a thousand years, and a thousand years are like a 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 worshiping God as He was creating the world: "Where were you when I laid the earth's foundation? Tell me, if you understand. Who marked off its dimensions? Surely you know! Who stretched a measuring line across it? On what were its footings set, or who laid its cornerstone - while the morning stars sang together and all the angels shouted for joy?" (Job 38:4-7).
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 "ministering spirits sent to serve those who will inherit 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, worshiping Him and serving Him.
So, 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 cannot be sure.