Daniel wrote his prophecy as an exile in Babylon between 605 and about 536 BC. Daniel was taken away into exile in 605 BC, almost twenty years before the fall of Jerusalem. The fall of Babylon occurred in 539 BC.
Daniel's book consists of accounts of his experiences in Babylon and of prophetic visions of the future.
Daniel Is Taken to Babylon
11In the third year of the reign of Jehoiakim king of Judah, Nebuchadnezzar king of Babylon came to Jerusalem and besieged it. 2The Lord gave Jehoiakim king of Judah into Nebuchadnezzar's hand, along with some of the vessels of the House of God, and he brought them to the land of Shinar[], into the house of his god. He brought the vessels into the treasury of his god. 3The king told Ashpenaz, the chief of his court officials,[] to bring some young Israelite men from the royal family or from the nobility. 4He was to choose young men who had no blemish, who were good looking, who had insight into all kinds of wisdom, who possessed knowledge, understanding, and learning, and who were capable of serving in the king's palace, in order to teach them the literature and language of the Chaldeans. 5The king assigned them daily rations from the special royal food and from the king's own wine. He ordered that they should be trained for three years. At the end of training they were to serve the king. 6In this group of young men were the Judeans Daniel, Hananiah, Mishael, and Azariah. 7The chief of the officials gave them new names. He gave Daniel the name Belteshazzar, Hananiah the name Shadrak, Mishael the name Meshak, and Azariah the name Abednego. The Young Men Are Steadfast in Their Faith
8Daniel made up his mind that he would not defile himself with the special food of the king or with the wine that he drank. So he sought permission from the chief official, so that he would not have to defile himself. 9God made the chief of the officials favorable and sympathetic toward Daniel. 10Then the chief of the officials said to Daniel, “I am afraid of my lord the king, who assigned your food and your drink. Why should he see your faces looking less healthy than those of the other young men who are your age? You put my life at risk before the king.”
11Daniel said to the superintendent whom the chief of the officials had placed over Daniel, Hananiah, Mishael, and Azariah, 12“Please test your servants for ten days. Tell them to give us only vegetables, and we will eat them and drink water. 13Observe our appearance and the appearance of the young men who eat the special royal food. Then deal with your servants based on what you see.” 14So he listened to what they said about this and tested them for ten days.
15At the end of ten days, their appearance was noticeably better than that of the others. They were healthier than any of the young men who had been eating the special royal food. 16So the superintendent permanently took away the special royal food and the wine they were to drink and gave them only vegetables. 17As for these four young men, God gave them knowledge and insight into all kinds of literature, as well as wisdom. In addition, Daniel also understood every kind of vision and dream.
18At the end of the time which the king had set for them to be brought to him, the chief of the officials brought them before Nebuchadnezzar. 19The king spoke with them, and none of the others were found to be comparable to Daniel, Hananiah, Mishael, and Azariah. So they served the king. 20In every matter concerning wisdom and understanding that the king sought from them, he found them ten times better than all the magicians[] and spell casters in his entire kingdom. 21So Daniel remained there until the first year of King Cyrus.