Atavachron

The atavachron was a computer device utilized on the planet Sarpeidon to prepare its inhabitants for use of a time portal, by altering the user's cellular structure and brain patterns for survival in their selected time period. Without processing by the atavachron, one could only survive in that time period for a matter of hours, but it would also cause the user's instant death if they were to return through the portal.

The Sarpeidon female Zarabeth was banished to that planet's ice age by the dictator Zor Kahn for her association with dissenters.

In 2269, the USS Enterprise (NCC-1701) arrived at Sarpeidon as their sun was about to go supernova. They discovered that the planet's inhabitants had utilized the time portal to travel to various points in their planet's past to escape destruction, and met the last inhabitant, Mr. Atoz, a librarian who had helped the inhabitants choose their destinations by using a library of verism tapes, which detailed information on the time periods. Captain Kirk, Commander Spock, and Doctor McCoy accidentally traveled through the portal, Spock and McCoy arriving 5,000 years in the past where they met Zarabeth. While there, Spock began to regress to the behavior of Vulcans of that time period, displaying increased emotionalism and an inability to control his aggressive tendencies. Eventually, all three of them were able to return through the portal, as they had not been processed through the atavachron. 

Atavachron