This isn't an anime plot, as far as I'm aware. In anime, you usually travel through time the same way you do in American shows -- either by a device, by accidentally going to a time rift area (in Japan, usually in a Shinto sacred area), or by psychic powers.