I think it also has something to do with the day of the Lord at the end of this age as well as judgment against ancient Babylon.
Isaiah 13:9-13
9 Behold, the day of the Lord is near, cruel with fury and burning anger, to make the land a desolation. And He will exterminate its sinners from it.
10 For the stars of heaven and their constellations will not flash forth their light; The sun will be dark when it rises and the moon will not shed its light.
11 Thus I will punish the world for its evil and the wicked for their iniquity; I will also put an end to the arrogance of the proud and abase the haughtiness of the ruthless.
12 I will make man scarcer than pure gold and mankind than the gold of Ophir.
Prophecy often time had an immediate fulfillment that occurred within or close to the lifetime of the hearers but also an exhaustive and complete fulfillment in the distant future.
Thus Christ spoke,
Matthew 24:31
31 But immediately after the tribulation of those days the sun will be darkened, and the moon will not give its light, and the stars will fall from the sky, and the powers of the heavens will be shaken. Christ describes the same celestial phenomenon that Isaiah first recorded.
The sun becoming dark just prior to His coming. The moon not giving its light. The very stars and constellations being affected. Just as Isaiah spoke of.
Earlier, the prophet Joel spoke,
Joel 3:14-15
14 Multitudes, multitudes in the valley of decision! For the day of the Lord is near in the valley of decision.
15 For the sun and moon grow dark and the stars lose their brightness.
Same as Isaiah and Jesus spoke of as occurring at the day of the Lord.
Peter in Acts 2:17-21,
17 And it shall be in the last days, God says, that I will pour forth of My Spirit on all mankind, and your sons and daughters shall prophesy, and your young men shall see visions, and your old men shall dream dreams;
18 Even on my bondslaves, both men and women, I will in those days pour forth of My Spirit and they shall prophesy.
19 And I will grant wonders in the sky above and signs on the earth below.
20 The sun will be turned into darkness and the moon into blood, before the great and glorious day of the Lord shall come.
21 And it will be that everyone who calls on the name of the Lord shall be saved.
Peter spoke as did Isaiah, Joel and Jesus regarding celestial events accompanying the day of the Lord. Foreshadowed by former prophecies regarding ancient Babylon spoken of by Isaiah. They were tracking with one another even though centuries apart at times.I think it was judgment on ancient Babylon for sure while at the same time speaking of the future when these celestial occurrences happen in relation to the day of the Lord (spoken of by Paul in II Thess 2:2 and many other places).
It's my opinion of course. Not looking for contention in another's thread, just sharing.
Blessings Mr. BillPro