Answer
Daniel was written shortly after 539 B.C. It was written by Daniel to assure those who had been in exile that God was Sovereign and in control of all history (Matt. 24:15). Since Daniel and his friends were loyal to God during the exile, he could be trusted to tell the truth about Israel's future. Though there would be trials in Israel's future, God would be faithful.