The question sometimes arises, what speculative literature time period to write in. In fantasy there seems to only be a couple of choices. In High Fantasy the era is probably some sort of Medieval, though the ancient world and possibly the Renaissance are possibilities. Unless one is writing Urban Fantasy, in which case it is set in the present. I have written one fantasy novel still in rewrite process in which the time period is the turn of the 19th-20th Century. I thought it might be considered Urban Fantasy, but was told by a published writer that it fit the category of Steampunk. I have also thought of writing in a world in which magic is the dominant technology of the future, and the stars are explored through the use of the ritual manipulation of energy. Kind of like Star Trek meets Dungeons and Dragons. The good thing about time periods in Fantasy is they exist in a different world. Eras can be mixed. The writer does have to be careful to not use 20th Century thought patterns and morality in their characters, and some historical accuracy is to be desired. Otherwise, anything goes, as long as there is consistency.
Alternate history is the easiest in my opinion when it comes to picking a time period. If it’s World War 2 it has to be set in the late 1930s through the 1940s. New characters can be created to fill roles. Real characters can die before their time. In fact the situation may require a character to die before they really did. Hitler comes to mind. If Germany has a chance in Hell of winning the war, then the supreme idiot needs to be taken out. Now if it’s set in the future it is not alternate history.
In science fiction the writer can go in two directions, the near or the far future. I guess the story can also be set in the past, such as in Turtledove Balance series, in which aliens come to conquer Earth in the middle of WW2. Though called alternate history, I think it fits the mold of science fiction. Near future science fiction is set within the next ten to fifty years. Depending on the age of the writer, he or she runs the risk of being dated. Say I write a story set in 2020. 2020 rolls around and nothing I have written about comes to pass. In fact, the real world looks like nothing like the world I have described. The book is dated, and most probably forgotten. I say most probably because much of the literature of the past is still popular even though the things described by the author did not come to pass. Now the convenience of near future fiction is characterization. I expect most people ten to twenty years from now will act more or less like people today. I may be wrong. The hundred thousand survivors of the Zombie Apocalypse may not act like people today, when survival is the main goal. But if the world continues as today the people should be more or less the same. People will raise families. People will plan for their future. Some will scheme and cheat and steal to get what they want. Wars will probably be fought. Unless civilization falls things will probably go on. There may be some changes. Look at the state of families today compared to when I was a child. In the 1960s it was a badge of shame for a woman to have a child out of wedlock. I currently work for a State Agency dealing with children, and today I am almost surprised when the child has the same last name as the mom, and when siblings have the same last names.
Now in the far future I may not have to worry about being dated. If someone is reading my work four hundred years from now I really don’t have to worry about what they think. The challenge of writing in the distant future is characterization. Will people still behave the same as they do today? Will they have the same goals and motivations? In the world of Star Trek, where the accumulation of material wealth is not a concern, will greed be a motivating factor? Is it really possible for someone to farm for a living on a desert world when technology can create anything, like Luke’s uncle and aunt in Star Wars? How about longevity and its effects. If people live forever, or even three to four hundred years, will they engage in less risky behaviors, in order to protect the life span? Or will they engage in more risky behaviors out of boredom? What about children. If confined to one world the population will soon outstrip the ability of the planet to support it. If people don’t die then children cannot be born. What would society be like if children are only one percent of the population? Less? Will they be treasured members of society, or ignored by most? If people are able to access any information they need from a computer directly to their minds will there be a need for the experts treasured by a society? Will there be Doctors, Lawyers, Scientists? One idea I have for a far future tale is a society in which everyone gets whatever they need, all provided for them whenever they want, with no need for any real world skills. And then the world collapses, and it is back to the strong, and the lucky, survive.