As long as people have been telling stories, they've been using fiction to reimagine the past and predict the future. This chart from Randall Munroe of XKCD shows exactly how the two relate.
The x axis shows the date of publication, while the y axis charts when the story was set. For example, 2001: A Space Odyssey was set in 2001, but it was made in 1968. American Graffiti was made in 1973, but it was set 11 years earlier, in 1962. It's a great way to understand how fiction works as a form of time travel. You can see the chart below or parse a larger version here.
Each area has a few fascinating observations that are easy to overlook. For example, in the lower left, you can see old works that were set in the past. Because these works are sometimes hundreds of years old, it's hard to recognize that they were intended to depict a time period even further in the past.
Though the list isn't comprehensive, it's also interesting to note that stories set in the far distant past don't appear until the 1960s. That makes sense, considering prevailing consensus about the age of the Earth before that time.
Finally, the two lines on the chart are worth noting as well. For the stories set in the future, the line notes stories set in 2015. For the stories set in the past, the line notes those that were written a certain number of years ago, but set twice that many years ago.