Lots of science fiction stories today are set in the future. Sometimes they give a specific date, like they'll say "AD 2532". Sometimes it's not spelled out but it's obvious, like I'm not sure if Star Trek ever gave an actual date, but it's obviously supposed to be a few hundred years from now.
What was the first story to do this?
By "the future" I mean the writer's future, not necessarily ours. If you know of a story written in AD 1000 but set in AD 1500, in which the writer talks about amazing future technologies like the printing press, and discovery of a new continent to the west, that's exactly the sort of thing I'm looking for.
I'm sure we could get into quibbles over definitions. I'm looking for "stories", things that could be called "science fiction stories" in some broad sense. I want to rule out statements of future intent, like, "Next year we will attack the Ottoman Empire", or simple predictions of consequences, like, "Ceasar, if you don't reinforce Gaul, within five years the barbarians will invade."
Arguably there could be a fine line between a warning and a story. Like, "If you continue on this course, I see a time, maybe ten or twenty years from now, when the barbarians will invade. Perhaps it will begin with a barbarian horde attacking the outpost at ..." At some point a discussion of what could happen in a hypothetical situation could cross the line into being a story. If you know of borderline examples, feel free to mention them.
I'd also exclude stories that talk about the passage of time without specifying the start and end points in any way. I'm thinking, for example, of Rip van Winkle: A man is put under a spell that makes him sleep for 20 years. But I don't think the story ever says whether it starts in the present and he wakes up 20 years in the future, or he started 20 years ago and wakes up in the present, or if the start and end are both in the past, or, more likely, that it just doesn't matter to the story, because it's not about social or technological change over time but about one person's personal and family life.
Let's also rule out religious prophecies. The accuracy and significance of such prophecies is a fascinating question -- and probably more important than the question I'm asking! -- but that's a totally different subject, and wouldn't be within the scope of this forum anyway.