What year was each book of the Old Testament written?
The Old Testament is divided into five sections: the Pentateuch (Genesis through Deuteronomy), the historical books (Joshua through Esther), the poetic books (Job through Song of Solomon), the Major Prophets (Isaiah through Daniel), and the Minor Prophets (Hosea through Malachi). The Old Testament was written from approximately 1400 B.C. to approximately 400 B.C. The Old Testament was written primarily in Hebrew, with a few small sections written in Aramaic (essentially a variation of Hebrew).
The Old Testament deals primarily with the relationship between God and the nation of Israel. The Pentateuch deals with the creation of Israel and God establishing a covenant relationship with Israel. The historical books record Israel's history, its victories and successes along with its defeats and failures. The books give us a more intimate look at God's relationship with Israel and His passion for Israel to worship and obey Him. The prophetic books are God's call to Israel to repent from its idolatry and unfaithfulness and to return to a relationship of obedience and spiritual fidelity.
We have a few basic ways of knowing when the individual books of the Bible were written: a combination of internal and external evidence and, particularly in the Old Testament, traditional accounts.
Internal evidence might consist of the style of writing and mentions of people or places who can be more precisely dated. For example, while the book of Ruth is set during the time of the judges, scholars place the literary style as that of the time of the Israelite monarchy—the Kings—based on other writings more accurately dated to that time. The mention of David (Ruth 4:17, 22) also implies a date some time after David’s reign.
Another example: the book of Daniel uses a literary style and specific Persian and Greek words that place it around the time of Cyrus the Great (ca. 530 B.C.). Linguistic evidence from the Dead Sea Scrolls gives us authentically dated examples of Hebrew and Aramaic writing from the second and third centuries B.C., when Daniel was written.
Other internal evidence might be the concerns the author is addressing. For example, the two books of Chronicles tell the history of the Jewish people and how they came under God’s judgment in the form of the exile to Babylon. Traditionally, believed Ezra to be the author of these books, because the following two books, Ezra and Nehemiah (also written by Ezra), deal with the return from exile and the need to be obedient to God’s law, and they are written in nearly the same literary style.
The date of that return, which began under Cyrus the Great, can be correlated to historical records outside the Bible that place his reign from approximately 559 to 530 B.C. The dedication of the new temple in Jerusalem, in 516 B.C., is corroborated by the records of Darius I, and a second return of exiles was allowed under Artaxerxes I, whom we know ruled Babylon from 465 to 424 B.C. All these things help us to closely place the writings of those particular books of the Old Testament. Biblical cross-referencing is used to date other books of the Old Testament.
In the New Testament, books are generally dated by the concerns being addressed, e.g., the growing Gnostic heresy, and how much they quote from other New Testament writings and a cross-referencing of events such as the collection for the needy in Jerusalem discussed in Romans and 1 and 2 Corinthians. We also have historical, extra-biblical accounts such as that by the Jewish historian Flavius Josephus to corroborate events described in the Bible.
The Gospels are often dated by something that is not mentioned: Jesus predicted the fall of Jerusalem in Matthew 24:1-2, and we know from historians such as Josephus that the city fell in A.D. 70. It seems logical that if such a prominent prophecy had been fulfilled before the writing of the Gospels that it would have been mentioned, as is the fulfilled prophecy of Christ’s resurrection as found in John 2:19, 22.
It’s important to note that even among scholars who believe the Bible to be God’s inspired, inerrant Word there is some disagreement as to the exact dating of the biblical books.