Exactly. There is *internal* evidence for when they were written, often when the stories were originally told.Another is the pattern of accuracy. If book that was supposedly written in 1780 predicts a future President, Donald Trump, and gets quite a bit of the history of 2016 right but somehow messes up quite often on the history of the late 18th century, George Washington manning the airports for example, then we could be pretty sure that it was not written in 1780 but some some time after 2016. I do believe that some of the "prophecies" of the Bible follow that pattern.
On top of that comes the archeological evidence, the historical evidence, the textual evidence, etc.