The fall of Northern Kingdom of Israel (10 tribes) to Assyrians was in (722 BC)
The fall of Southern Kingdom of Judah (2 tribes) to Babylonians in (605 BC + 597 BC + 586 BC)
In 586 BC the 1st Temple, Solomon’s Temple, was Looted and Destroyed by Nebuchadnezzar.
Most Jews were deported to Babylon for 70 years, as prophesied by Jeremiah (Jer 25:11, 29:10).
During the Exile the Prophet Daniel was told that Gentile kingdoms would be dominant over the Kingdom of S. Judah and N. Israel, until God would set up His kingdom on the earth under the rule of the Messiah (Dan 2, Dan 7). This period was referred to by Jesus as “the times of the Gentiles” (Luke 21:24).
Then Babylonian Empire fell to the Persian Empire in (539 BC),
Cyrus the Great was stirred by God to decree that the Jews could return to Jerusalem to rebuild their Temple in (538 BC), (Ezra 1:1-2, 6, 6:3-5, 2 Chr 36:22, Isa 44:28).
However, only 50,000 Jews (including Haggai and Zechariah) returned under Zerubbabel the governor and Joshua the high priest (Ezra 2).
Levitical sacrifices were soon reinstituted, on a rebuilt altar of burnt offering (Ezra 3:1–6).
In, 536 BC, the foundation of the Temple was laid (Ezra 3:8–13; 5:16).
However, external oppression and internal depression halted the rebuilding of the Temple for about 16 more years of spiritual apathy, until the rule of the Persian King Darius I (522–486 BC).
In the second year of Darius I (520 BC) God raised up Haggai the prophet to encourage the Jews in rebuilding (Ezra 5:1–2, Hag 1:1).
Zechariah began his prophetic ministry (520 BC) (Zech 1:1), encouraging the Jews to spiritual renewal and motivating them to rebuild the Temple by revealing to them God’s plans for Israel’s future. The people completed the Temple in 515 BC (Ezra 6:15).
The prophecies of Zechariah 9–14 were written later, about 480BC to 470BC .