In the first year of Dareyawesh the son of Ahashwerosh, of the seed of the Medes, who was set up as sovereign over the reign of the Kasdim – in the first year of his reign I, Daniel, observed from the Scriptures the number of the years, according to the word of YHWH given to Yirmeyah the prophet, for the completion of the wastes of Yerushalayim would be seventy years.
TS2009 - Daniel 9:1-2
Daniel is reading Jeremiah in order to find out how long exactly Jerusalem and the temple would be in ruins. King Nebuchadnezzar destroyed Jerusalem and the temple in 586 BC. According to Jeremiah Jerusalem would be in ruins for 70 years (Jeremiah 25:11-12, Jeremiah 29:10-15). So somewhere around 516 BC Jerusalem and its temple would be restored. The Babylonian captivity started around 600 BC. When Cyrus the Great conquered Babylon in 539 BC the Jews were allowed to return to Jerusalem. So Daniel had this vision close to 539 BC. It is likely that Dareyawesh, the son of Ahashwerosh, refers to Cyrus the Great because he was born from Cambyses I and Mandane of Media.
while I was still speaking in prayer, the man Gabriel, whom I had seen in the vision at the beginning, came close to me, in swift flight about the time of the evening offering. And he made me understand, and talked with me, and said, “O Daniel, I have now come forth to make you wise concerning understanding. “At the beginning of your supplications a word went out, and I have come to make it known, for you are greatly appreciated. So consider the word and understand the vision:
TS2009 - Daniel 9:21-23
While Daniel was praying to God the messenger Gabriel visited him.
"Seventy weeks are decreed for your people and for your set-apart city, to put an end to the transgression, and to seal up sins, and to cover crookedness, and to bring in everlasting righteousness, and to seal up vision and prophet, and to anoint the Most Set-apart.
TS2009 - Daniel 9:24
God set an ultimatum for His people. He foretold the coming of the Messiah as prophecied by the Old Testament prophets. In prophecy time periods are often not to be taken literally. The context usually gives hints as to how they should be interpreted. In the first verses of this chapter Daniel clearly speaks of years. A little later on we'll see that the rebuilding of the temple takes about 49 years which is prophecied by Gabriel with 7 weeks, or 7 x 7. So the weeks in this prophecy are periods of 7 prophetic years (Genesis 29:27). Then the prophetic period of 70 weeks equals 490 prophetic years (70 x 7). See also Matthew 18:21-22 for an allegory.
"Know, then, and understand: from the going forth of the command to restore and build Yerushalayim until Messiah the Prince is seven weeks and sixty-two weeks. It shall be built again, with streets and a trench, but in times of affliction. "And after the sixty-two weeks Messiah shall be cut off and have naught.
TS2009 - Daniel 9:25-26a
The Jews returned to Jerusalem starting around 539 BC, shortly after Cyrus the Great conquered Babylon. To build a city one needed permission from the king of the ruling empire. In the first year of his rulership king Cyrus the Great gave permission to God's people to rebuild the house of God in Jerusalem (Ezra 1:1-3). After more than 2 years and 2 months the foundation was layed (Ezra 3:8-10). But the Jews encountered opposition from the local people and were not able to build the temple during the reigns of Cyrus the Great and Darius I (Ezra 4). The prophet Nehemiah asked king Artaxerxes in the 20th year of his reign to let him return to Jerusalem to rebuild it (Nehemiah 2:1-5). The king granted permission. Artaxerxes started his reign around 465 BC so Nehemia went to Jerusalem 20 years later around 445 BC. Nehemiah arrived at Jerusalem and revealed his plans to the people to rebuild Jerusalem (Nehemiah 2:9-20). The building of the second temple took 46 years (John 2:20). The seven weeks mentioned by Gabriel point to the time necessary for completion of the temple: 7 x 7 = 49 years. It would take 69 weeks from the command to rebuild until Messiah. Now it's important to know that prophetic years have 360 days in which months have 30 days. So 69 weeks equals 483 prophetic years (360 days/year) which equals 476 modern years (365.24 days/year). Adding 476 modern years to 445 BC gives a date around 31 AD or 30 AD without counting the year zero. This is very close to the three year period between the Messiah being baptized and his crucifixion when He got "cut off". Interestingly, here is what the Messiah said to the Jews in the temple soon after He was baptized and about three years before His crucifixion...
And the Yehudim answered and said to Him, “What sign do You show to us, since You are doing these?” YHWSO answered and said to them, “Destroy this Dwelling Place [temple], and in three days I shall raise it.” Then the Yehudim said, “It took forty-six years to build this Dwelling Place [temple], and You are going to raise it in three days?” But He spoke about the Dwelling Place [temple] of His body.
TS2009 - John 2:18-21
This is impressive. This very sentence was misinterpreted by the Jewish authorities and abused to bring Him to death before Pilate. The Son of God wilfully layed down His life and knew that God would raise Him from the dead after three days in the tomb (Matthew 12:40). Another interesting fact is that His answer to the Jews in the temple was done at the beginning of His three-year ministry (John 2:11) on earth before His crucifixion, shortly after John the Baptist immersed Him (John 1:33).
The seventieth week
“And after the sixty-two weeks Messiah shall be cut off and have naught. And the people of a coming prince shall destroy the city and the set-apart place. And the end of it is with a flood. And wastes are decreed, and fighting until the end. "And he shall confirm a covenant with many for one week. And in the middle of the week he shall put an end to slaughtering and meal offering. And on the wing of abominations he shall lay waste, even until the complete end and that which is decreed is poured out on the one who lays waste."
TS2009 - Daniel 9:26b-27
The Messiah was crucified around 30 AD. At that time the Roman Empire was in control of Judea. So in Daniel's time the coming prince is likely the Roman emperor. From 66 to 73 AD the First Jewish–Roman War took place, a seven year period which could fit with the seventieth week in Daniel's vision. In the middle of that 7 year period, 40 years after the crucifixion, in 70 AD the siege and destruction of Jerusalem took place and the Second Temple was burned. In the Scriptures a 40 year period is a period of cleansing (Genesis 7:17), trial (Numbers 14:34, Luke 4:2), fasting (Deuteronomy 9:9), and testing (1 Samuel 17:16). Perhaps this points to the possibility that in this vision the timing of events is not necessarily sequential, but may in fact have periods inbetween related to cleansing, trial, fasting, and testing.
Obviously history continued since the literal destruction of the temple and the world experienced much greater distresses under Satan's rule. The Good News of the Kingdom of Heaven was first preached to the lost sheep of Israel who were scattered in that region (Matthew 10, Matthew 15:24) in order to redeem them from the Old Testament Law (Galatians 4:5). So the Old Testament Jews who rejected the Son of God were the first people warned and the first punished. The Jews rejected the Messiah and turned their backs on God. Then God turned to the rest of the people (Acts 10:9-47, Acts 13:46-47, Acts 17:24-31). God wants to save all people (Joel 2:32, 1 Timothy 2:4).
It is very likely that this last verse contains a more important meaning, not necessarily predicting the destruction of the literal temple, but predicting the time of the end when the Son of God comes back like a thief in the night to bring Satan's Global Empire or world government to an end. There are two Jerusalems, one literal Jerusalem and one spiritual Jerusalem which is called the "New Jerusalem" (Revelation 3:12). The original first temple in Jerusalem was destroyed by Babylonian king Nebuchadnezzar in 586 BC. The other temple that the Son of God talks about in Matthew 24 is His Body which has to do with the spiritual New Jerusalem, or God's Kingdom, not with any [insignificant] literal earthly temple.