The setting of Ruth is in the time of the Judges:
Ruth 1:1 During the time of the judges there was a famine in the land of Judah. So a man from Bethlehem in Judah went to live as a resident foreigner in the region of Moab, along with his wife and two sons. [NET Bible]
It must have been written after the time of King David as it points out he is descended from the principal characters twice in the last few verses.
4:17 The neighbor women named him, saying, "A son has been born to Naomi." They named him Obed. Now he became the father of Jesse – David’s father!
4:22 Obed was the father of Jesse, and Jesse was the father of David.
This link to David serves to show why the book is important enough for inclusion in the canon. The fact that David was descended from Moabites would also explain why he sought refuge with them when being pursued by Saul (1 Samuel 22:3).
However, most scholars now date the book much later than the time of David. There are three time periods generally given for the book of Ruth.
- The time of David - based upon the absence of Solomon in the genealogy and the fact that the customs presented in Ruth are different from the later period.1
- During Josiah's reforms - as Ruth is said to betray a knowledge of Deuteronomy 25 which they claim was not written until the time of Josiah.2
- After the Exile3, specifically as a counter to Nehemiah's edict to put away foreign wives.4
What evidence shows the date for the Book of Ruth?
1Archer, Gleason L. A Survey of Old Testament Introduction, 307. Malick, David. An Introduction to the Book of Ruth.
2Mentioned by Archer but no scholar holding the view cited.
3Grabbe, Lester L. (2004). The History of the Jews and Judaism in the Second Temple Period, Volume 1: Yehud, the Persian Province of Judah.
4Jewish Encyclopedia, sv. Book of Ruth.