Trelane says he studied Earth images that travelled to him at light speed, and earlier they establish Gothos is 900 years from Earth. But Trelane references Napoleon and Hamilton, who weren't around until 1800 or so. That would put this episode in 2700, but the original Trek episodes are set in the 2200's.