On studying the scriptures (Jeremiah 24:8-11), Daniel knew that the exile to Babylon was about to end and he prayed and confessed their sins on behalf of his people to God for keeping His promise to let his fellow people return to their homeland. The seventy years mentioned in Jeremiah 24:11 refers to the periord probably began in the fourth year of Jehoiakim when Jerusalem was first attacked by Nebuchadnezzar in 605/604 B.C. and ended with the decree of Cyrus to let the Jews return in 536/535 B.C. [1]. Then God revealed to Daniel the prophecy of seventy weeks (or units of seven) of years concerning the ultimate future of Israel in the context of world history (Daniel 9:20-27).

Jeremiah 24:8-11

8 Therefore the LORD Almighty says this: "Because you have not listened to my words, 9 I will summon all the peoples of the north and my servant Nebuchadnezzar king of Babylon," declares the LORD, "and I will bring them against this land and its inhabitants and against all the surrounding nations. I will completely destroy a them and make them an object of horror and scorn, and an everlasting ruin. 10 I will banish from them the sounds of joy and gladness, the voices of bride and bridegroom, the sound of millstones and the light of the lamp. 11 This whole country will become a desolate wasteland, and these nations will serve the king of Babylon seventy years.

Daniel 9:20-27

20 While I was speaking and praying, confessing my sin and the sin of my people Israel and making my request to the LORD my God for his holy hill- 21 while I was still in prayer, Gabriel, the man I had seen in the earlier vision, came to me in swift flight about the time of the evening sacrifice. 22 He instructed me and said to me, "Daniel, I have now come to give you insight and understanding. 23 As soon as you began to pray, an answer was given, which I have come to tell you, for you are highly esteemed. Therefore, consider the message and understand the vision: 24 "Seventy 'sevens' are decreed for your people and your holy city to finish transgression, to put an end to sin, to atone for wickedness, to bring in everlasting righteousness, to seal up vision and prophecy and to anoint the most holy. 25 "Know and understand this: From the issuing of the decree to restore and rebuild Jerusalem until the Anointed One, the ruler, comes, there will be seven 'sevens,' and sixty-two 'sevens.' It will be rebuilt with streets and a trench, but in times of trouble. 26 After the sixty-two 'sevens,' the Anointed One will be cut off and will have nothing. The people of the ruler who will come will destroy the city and the sanctuary. The end will come like a flood: War will continue until the end, and desolations have been decreed. 27 He will confirm a covenant with many for one 'seven.' In the middle of the 'seven' he will put an end to sacrifice and offering. And on a wing of the temple he will set up an abomination that causes desolation, until the end that is decreed is poured out on him.

The prophecy mentions three periods in terms of 'sevens': 7 sevens, 62 sevens and 1 seven i.e. a total of 70 sevens or 490 in total. The first period starts from the issuing of the decree to restore and rebuild Jerusalem and ends when the Anointed One i.e. the Messiah comes. The prophecy mentions that the Messiah will be cut off at the second period, this means that the the coming of the Messiah at the end of third period must mean the second coming of the Messiah in His glory to rule the world (Revealation 1:4-8). We know that the first coming of the Messiah was the birth of Jesus as a baby in the manger (Isaiah 9:6; John 1:14). Jesus suffered crucification and death to pay for the wages of sins for all mankind such that all who belive in Him will not perish but have everlasting life (Isaiah 53:5 ; John 3:16) for all who believe in Him will be united in His resurrection (Romans 6:5).

Isaiah 9:6

6 For to us a child is born, to us a son is given, and the government will be on his shoulders. And he will be called Wonderful Counselor, Mighty God, Everlasting Father, Prince of Peace.

John 1:14

14 The Word became flesh and made his dwelling among us. We have seen his glory, the glory of the One and Only, who came from the Father, full of grace and truth.

Revealation 1:4-8

4 John,
To the seven churches in the province of Asia: Grace and peace to you from him who is, and who was, and who is to come, and from the seven spiritsa before his throne, 5and from Jesus Christ, who is the faithful witness, the firstborn from the dead, and the ruler of the kings of the earth. To him who loves us and has freed us from our sins by his blood, 6and has made us to be a kingdom and priests to serve his God and Father—to him be glory and power for ever and ever! Amen. 7Look, he is coming with the clouds, and every eye will see him, even those who pierced him; and all the peoples of the earth will mourn because of him. So shall it be! Amen. 8"I am the Alpha and the Omega," says the Lord God, "who is, and who was, and who is to come, the Almighty."

Isaiah 53:5

5 But he was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed.

John 3:16

16"For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.

Romans 6:5

5 If we have been united with him like this in his death, we will certainly also be united with him in his resurrection.

The meaning of the 'seven' in its original language has no unit and has been used in the scriptures multiple times and it can mean a seven-day week, a Feast of Weeks, and in this case seven years. It is more reasonable to interprete 'seven' as 'seven years' because, firstly, Daniel was thinking in terms of years (Daniel 9:2). Secondly, Daniel understood that the captivity of seventy years was a punishment of Israel's violation of the command to give the land a year of sabatical rest for every seven years and there were 70 violations during Israel's 490 years of history (2 Chronicles 36:21). Thirdly, there are no historical events that fit the 490 days or 490 weeks period. Only the interpretation of 490 years provides meaningful events in history as we see later.

Daniel 9:2

2 in the first year of his reign, I, Daniel, understood from the Scriptures, according to the word of the LORD given to Jeremiah the prophet, that the desolation of Jerusalem would last seventy years.

2 Chronicles 36:21

21 The land enjoyed its sabbath rests; all the time of its desolation it rested, until the seventy years were completed in fulfillment of the word of the LORD spoken by Jeremiah.

References:
1. John MacArthur, The MacArthur Study Bible, 1997 by Word Publishing.