If you’ve ever felt like there just aren’t enough hours in the day just be glad that you didn’t live on Earth 1.4 billion years ago. A new study led by researchers at the University of Wisconsin – Madison reveals that ancient Earth had much shorter days, and the 24-hour days that we experience in modern times come courtesy of the Moon.

The study, which was published in the Proceedings of the National Academy of Sciences, describes how the researchers created a method to rewind Earth’s clock by hundreds of millions of years. The system allowed the team to paint a rough picture of what a day on Earth might have been like over a billion years in the past, and better explain the evidence of climate shifts that have been observed in ancient rocks.

Earth’s Moon is currently moving away from us at an extremely slow rate, just shy of 4 centimeters per year. As the Moon gets farther away, it slows down Earth’s rotation, and working backwards from the present day the researchers determined that around 1.4 billion years ago the Moon would have been close enough that a day on our planet would have lasted just 18 hours.

“As the moon moves away, the Earth is like a spinning figure skater who slows down as they stretch their arms out,” Professor Stephen Meyers of UW-M explains. But this is just one piece of the somewhat puzzling relationship between the Earth and the Moon.

The researchers note that if you take the timeline back far enough, looking 1.5 billion years in the past, the Moon would have been close enough that Earth’s gravity would have destroyed it. That obviously didn’t happen, but since the Moon is over 4 billion years old there was clearly an important piece missing from the data.

Meyers teamed up with Alberto Malinverno from Columbia University to complete the picture. Malinverno and Meyers combined “astronomical theory, geologic data, and a sophisticated statistical approach” to create a tool that allowed them to account for the uncertainty of the Earth-Moon relationship when studying rock samples. Using their new system they were able to accurately study incredibly old rock layers — such as the Xiamaling Formation in Northern China which is 1.4 billion years old — to determine what the Earth was doing at that point in its history, including the length of its days and its distance from the Moon.