The story takes place in "the poor little shabby village of St. Petersburg," the fictional equivalent of Hannibal, the Mississippi River town where Twain spent his early years. In his preface the author dates the action at "thirty or forty years ago," between 1836 and 1846, the era of his own boyhood.
The Adventures of Tom Sawyer, BookRags