The complex structure of the books begins with a Preface signed by Lloyd, which presents the frame concept, that Lloyd has discovered a thirty-year-old manuscript by Llewellyn Drury in a library. Then comes a Prologue in which Drury introduces himself.
The book's Chapter I begins the story of how Drury met the mysterious "I-Am-The-Man", who reads his own manuscript account of his adventures to Drury over many sessions. The mysterious stranger, also known as The-Man-Who-Did-It, relates events that supposedly occurred thirty years earlier, during the early part of the nineteenth century.
By his account, the speaker is kidnapped by fellow members of a secret society, because he is suspected to be a threat to their secrecy. (This was likely based on the 1826 kidnapping of William Morgan and the start of the Anti-Masonry movement.) I-Am-The-Man is taken to a cave in Kentucky; there he is led by a cavern dweller on a long subterranean journey. It becomes an inner journey of the spirit as much as a geographical trip through underground realms.
The book blends passages on the nature of physical phenomena, such as gravity and volcanoes, with spiritualist speculation and adventure-story elements (like traversing a landscape of giant mushrooms). The whole ends with a summary letter from "I-Am-The-Man" and a conclusion from Drury. Subsequent editions of the book added various prefatory and supplementary materials.
Although the secret society is not named, the narrator is made to take an oath by raising his hand and repeating after a man who acts as his guide, "To all this I most solemnly and sincerely promise and swear, with a firm and steadfast resolution to keep and perform my oath, without the least equivocation, mental reservation, or self-evasion whatever," reminiscent of initiatory oaths of multiple degrees in Masonry. And a man the narrator encounters around the end of the novel says "The future is operative and speculative," reminiscent of "operative" and "speculative" Freemasonry and the "speculative science and the operative art" in Freemasonry.

Question: When does this story take place?
Answer: The nineteenth century.
Alternative answer: 1820's