For millennia, people have used the stars to understand and organize the movement of time — here's how it works