Thanks for asking a question on www.thisisyourbible.com
Here is an excerpt from an online commentary on the book of Daniel
In 605 BC Prince Nebuchadnezzar led the Babylonian army of his father Nabopolassar against the allied forces of Assyria and Egypt. He defeated them at Carchemish near the top of the Fertile Crescent. This victory gave Babylon supremacy in the ancient Near East. With Babylon's victory, Egypt's vassals, including Judah, passed under Babylonian control. Shortly thereafter that same year Nabopolassar died, and Nebuchadnezzar succeeded him as king. Nebuchadnezzar then moved south and invaded Judah, also in 605 BC. He took some royal and noble captives to Babylon including Daniel, whose name means "God is my judge" or "God is judging" or "God will judge" (Dan 1:1-3), plus some of the vessels from Solomon's temple (2Ch 36:7). This was the first of Judah's three deportations in which the Babylonians took groups of Judahites to Babylon. The king of Judah at that time was Jehoiakim (2Ki 24:1-4).
Jehoiakim's son Jehoiachin (also known as Jeconiah and Coniah) succeeded him in 598 BC. Jehoiachin reigned only three months and 10 days (2Ch 36:9). Nebuchadnezzar invaded Judah again. At the turn of the year, in 597 BC, he took Jehoiachin to Babylon along with most of Judah's remaining leaders and the rest of the national treasures including young Ezekiel (2Ki 24:10-17; 2Ch 36:10).
A third and final deportation took place approximately 11 years later, in 586 BC. Jehoiakim's younger brother Zedekiah, whose name Nebuchadnezzar had changed to Mattaniah, was then Judah's puppet king. He rebelled against Babylon's sovereignty by secretly making a treaty with Pharaoh Hophra under pressure from Jewish nationalists (Jer 37; 38). After a two-year siege, Jerusalem fell. Nebuchadnezzar returned to Jerusalem, burned the temple, broke down the city walls, and took all but the poorest of the Jews captive to Babylon. He also took Zedekiah prisoner to Babylon after he executed his sons and put out the king's eyes at Riblah in Aramea (modern Syria; 2Ki 24:18 -- 25:24).
Daniel, the main character from whom this book gets its name, was probably only a teenager when he arrived in Babylon in 605 BC. The Hebrew words used to describe him, the internal evidence of Dan 1, and the length of his ministry seem to make this clear. He continued in office as a public servant at least until 538 BC (Dan 1:21) and as a prophet at least until 536 BC (Dan 10:1). Thus the record of his ministry spans 70 years, the entire duration of the Babylonian Captivity. He probably lived to be at least 85 years old and perhaps older.
There is little doubt among conservative scholars that Daniel himself wrote this book under the Holy Spirit's guidance. Probably he did so late in his life, which could have been about 530 BC or a few years later. Several Persian-derived governmental terms appear in the book. The presence of these words suggests that the book received its final polishing after Persian had become the official language of government. This would have been late in Daniel's life. What makes Daniel's authorship quite clear is both internal and external evidence.
Internally the book claims in several places that Daniel was its writer (Dan 8:1; 9:2,20; 10:2). References to Daniel in the third person do not indicate that someone else wrote about him. It was customary for ancient authors of historical memoirs to write of themselves this way (cf Exo 20:2,7).
I hope you have found this helpful.