In the Star Trek episode "The Squire of Gothos", Trelane suggested he was looking at Earth of 900 years ago, in the late 18th century, making Star Trek set in the 27th Century.
According to Wikipedia, it appears that the date when Star Trek was set in was made later than this episode.
Continuity
At the time episode was written there was no definite century in which Star Trek took place. It is stated that Gothos is 900 light years from Earth and that Trelane had "been looking in on doings nine hundred years past". However, Trelane references people and events of the late 18th and early 19th centuries putting Star Trek in the 27th century.
Which episode establishes the time Star Trek: TOS takes place is (roughly) the 2260s? Was it in the original series or ST:TNG?