Ask any knowledgeable Star Trek fan when Captain Kirk’s Five-Year Mission took place, and you’re likely to get the 2260s as the short answer. The longer answer is a bit more complicated.
When Star Trek first aired, from 1966 through 1969, the series and the details of its setting were very much in flux, particularly during its first season. Series creator Gene Roddenberry conceived of the concept of “stardates” in an effort to obscure the details of exactly when the series was set. In the book The Making of Star Trek, Roddenberry wrote, “In the beginning, I invented the term ‘Star Date’ simply to keep from typing [sic] ourselves down to 2265 A.D., or should it be 2312 A.D.? I wanted us well in the future but without arguing approximately which century this or that would have been invented or superseded.”
Most references to when the series was set were, accordingly, left intentionally vague. The Romulan War, a devastating interstellar conflict, was “a century ago,” as were the disappearances of the ships Archon and Horizon. More explicit references to the date were likewise vague, and occasionally contradictory.
When the Enterprise discovered a parallel Earth that had been devastated in the equivalent of the 1960s in the episode “Miri,” a ruined tricycle found on the street was said to be “about three hundred years” old, but as it was a parallel Earth, this didn’t necessarily mean that the series itself was set in the 2260s. “The Squire of Gothos,” the eighteenth episode of the series, gave the first hard evidence of the show’s setting. The planet Gothos was stated to be 900 light years from Earth. During the episode, the character Trelane was shown viewing light from Earth through a telescope, which he had used to model his clothing and surroundings. The images shown through his telescope were of Europe in the late eighteenth century. If he was viewing light that took 900 years to reach Gothos, as stated in the episode, then Star Trek must be set in the late twenty-seventh century, right?
Unfortunately, no other reference on the series to the date supports this. Just three episodes later, when the Enterprise accidentally time traveled back in time to the 1960s in “Tomorrow is Yesterday,” Captain Kirk was captured and interrogated by U.S. Air Force personnel. When threatened that he would be locked up “for 200 years,” Kirk replied, “that ought to be just about right.” Three episodes after that, genetic superman Khan Noonien Singh was revived from cryogenic stasis, and his year of origin, 1996, was said to be “about 200 years” in the past.
The outlier of Gothos and the ambiguity of “Miri” aside, the evidence points to Star Trek being set about two centuries after the end of the twentieth century, placing it either in the late twenty-second or early twenty-third century. When the Spaceflight Chronology was published in 1980, this was the figure seized upon by its writers, who placed the Five-Year Mission from 2207 through 2212. The Spaceflight Chronology soon became the accepted authority on the fictional future history of Star Trek, and remained such until the publication of the Star Trek Chronology in 1993.
The Star Trek Chronology, written by Star Trek production crew members Mike and Denise Okuda, ignored the contradictory evidence of the original series entirely, and seized upon the phrase “In the 23rd Century…” in the opening moments of Star Trek II: The Wrath of Khan. The Okudas’ Chronology operated under a number of “basic assumptions,” one of which was that the original Star Trek was set exactly 300 years after it first aired, placing the series from 2266 through 2269. Many years later, the Star Trek: Voyager episode “Q2” would further solidify this date, establishing that the Five-Year Mission ended in 2270.
“This project started,” the Okudas wrote in the introduction to the Chronology, “when Michael wanted to do a simple timeline to show the interrelationship of the first two Star Trek series, for use by the writers of Star Trek: The Next Generation. … Former Star Trek research consultant Richard Arnold proved to be a tremendous help at this stage, providing for us (as he had for some of the Star Trek: The Next Generation writers) many of the basic assumptions that form the framework on which this chronology is built. At about the same time, Star Trek creator Gene Roddenberry … realized that the solution was to compile a chronology to serve as a reference for writers … not knowing that Mike had already started preliminary work on this document!” This work by the Okudas and the input from Richard Arnold was reflected early on in Star Trek: The Next Generation, which established in its first season that Dr. McCoy was now 137 years old, and that the year was 2364.
Based solely on the evidence found in the episodes of the original series, Star Trek was apparently set in the early years of the twenty-third century. When later expansions to the Star Trek universe, particularly Star Trek: The Next Generation and the Star Trek Chronology, are taken into account, the series instead is clearly set in the latter half of the 2260s.