As the summer solstice draws closer, Stephen Meyers has been welcoming the few extra minutes of sunlight each day that light up his walk home. He knows that after the year’s longest stretch of sunlight on June 21, the days will get shorter as the seasons shift and winter approaches.

But Meyers, a geoscientist at the University of Wisconsin, Madison, knows something that gives him a longer view: Over billions of years of Earth’s history, the time it takes Earth to rotate once on its axis has been getting longer.

What Is a Solstice?

Meyers and a colleague recently showed that 1.4 billion years ago, a single “day” lasted only about 18 hours. And changes in the gravitational dance between our planet and the moon are causing Earth’s day to get ever so slightly longer each year.

“So if I just wait a few hundred million years,” he says, “I’ll get that extra hour back!”

So, what’s been altering Earth’s days over geologic time, and does this mean anything for solstices past and future? Here’s the breakdown.

What is a solstice, anyway?

Earth’s axis is tilted about 23 degrees relative to its orbital path around the sun. That’s about the angle between Spock’s fingers in the Vulcan salute.

Because of that tilt, the Northern Hemisphere sits a little bit closer to the sun than the Southern Hemisphere for half the year. That’s when it’s summertime in places such as Stockholm, Moscow, and Toronto. As Earth trundles along the second half of its orbit, the Southern Hemisphere faces the sun more directly, and it’s time for people in cities like Sydney and Buenos Aires to pull out the popsicles and sunblock.

On the summer solstice—June 21 in the north this year—the sun’s path through the sky arcs higher than on any other day of the year, hovering directly overhead anyone standing at the Tropic of Cancer at noon. At that time, someone in Havana, Cuba, will feel the sun beating straight down on them.

The sun also takes longer to travel across the sky on the June solstice than on any other day of the year. In Alaska, it won’t drop below the horizon, and in Wisconsin, Meyers will be able to linger in solstice daylight for a full 15 hours and 22 minutes.

What’s been influencing the length of Earth’s days?

But back when dinosaurs lumbered across the place where Madison stands today, Earth spun faster around its axis.

Earth’s spin has been slowing down for billions of years, explains Kurt Lambeck, a geophysicist from the Australian National University in Canberra, primarily because of the moon. The gravitational tug of the moon raises the ocean tide, and as the moon orbits Earth pulls the tide along with it. But the water but lags slightly behind, dragging on the ocean floor.

The moon also used to sit much closer to Earth, so its gravitational tug was much stronger than it is today. It’s falling farther away at a rate of about 3.8 centimeters a year, or roughly the speed at which human fingernails grow, and the drag effect is weakening.

Meyers and Alberto Malinverno of Columbia University wanted to figure out how far away the moon was from Earth at different times in the past, so they could see exactly how its gravitational effect has changed day length and other things that have influenced climate though deep time.

In a recently published paper in the Proceedings of the National Academy of Sciences, they worked out some of the celestial physics that would help them understand the way Earth moved around in space in the past. Back in the Proterozoic, a few million years after multicellular life appeared on the planet, the moon was about 211,825 miles away from Earth—about 21,000 miles closer than it is today. This, they figured out, compressed the length of a day down to 18.68 hours.

By the time land plants evolved about 470 million years ago, the days had stretched to 21.46 hours. And when the dinosaurs showed up 225 million years ago, the days lasted 22.68 hours. The roughly 24-hour day we have now was almost in place as the first ice sheets bloomed near the Northern Hemisphere’s poles about 3.5 million years ago.

What does that mean for the solstice?

That’s a little harder to answer, says Meyers, and it depends on a few more variables for how Earth moved around in the past.

As it orbits the sun, Earth is tugged in different directions by the gravitational pull of all the other planets in the solar system. This causes the axis to tilt a little more or a little less over time, drooping to just over 24 degrees and maxing out at about 22 degrees every 40,000 years or so.

When the planet sits more upright, the Poles get less total time in the sun than when the planet is tilted over more. The summer solstice—the day of the year with the most daylight—is therefore a little bit shorter when Earth is more vertically oriented.