Wells had considered the notion of time travel, having written an (unpublished) story he had titled The Chronic Argonauts. He had thought of using some of this material in a series of articles in the Pall Mall gazette, until the publisher asked him if he could instead do a serial novel on the same theme; Wells readily agreed, and was paid 100 pounds on its publication in 1896.
The (unnamed) Time Traveller, having demonstrated to friends that time is a fourth dimension, and that suitable apparatus can move back and forth in this fourth dimension, constructs a larger machine capable of carrying himself. His journey forward in time takes him to an apparently peaceful, pastoral future, filled with happy, simple folk who call themselves the Eloi.
The flaws in this future are revealed when the Traveller realises that the class structure of his time has persisted until the human race has diverged into two branches. The upper classes have evolved into the ineffectual, not very bright Eloi, and the downtrodden lower classes have evolved into the bestial Morlocks, who toil underground, maintaining the machinery that keep the Eloi in happy leisure. This is not a one-sided exploitation, however, as the Eloi are being maintained as food for the Morlocks. After some adventures, the narrator returns to his machine and travels into the far future, seeing the last few living things on a dying Earth, then returns to tell his story to friends, before disappearing forever into time.
This was released in 1960, and is more of an adventure film, with the division of humanity being the result of a nuclear war centuries earlier - though the story line is otherwise not greatly changed. The film is notable for its ingenious stop motion effects showing the world around the Time Traveller changing at breakneck speed as he travels through in time.
(this is mostly from memory, I'll check the details)