Caution: Bored Programmer Ahead

May 26, 2006

Hmm, that fall at the game Friday seems to have dislodged a couple entries. Guess the "Brain Farts" title may be accurate after all. Or maybe I just talk out of my ass too much. Anyway...

A couple weeks ago I caught up with the new goings-on over at Bad Astronomy and saw a lot about the two Mars rovers. In order to make the most of the daylight they receive, the rovers operate on "sols" -- the Martian day of about 24 hours and 40 minutes.

It got me to thinking about the rest of the Martian calendar, since as far as I know there's no official one. I set out to change that :)

Once I figured out a leap-year schedule (three every five years, skipping years divisible by 50) I decided to backtrack and find a good starting point for the calendar. I wanted to go a pretty good ways, so anything we're ever written down about the planet would happen in positive years. A not-so-quick back-of-the-envelope calculation places the Martian north winter solstice on the same day as January 1 way back in 1754 BCE, assuming my guess about when the Martian solstices happen is at all accurate.

That became the first day of the first month of Martian Year 0. Yes, on Mars we'll start counting from 0 like sensible people. Moving forward, assuming I did everything right, puts us in the second half of Martian Year 2018. The Viking landings happened sometime in the 1999-2001 range, which seems to fit nicely.

Then I realized that units were going to be a bitch. Human explorers to Mars would probably bring the concept of hours, minutes and seconds with them, but none of these things fit a Martian day particularly well. Since NASA has already started using the term "sol" for a Martian day, I went ahead and made up new names for everything.

With units figured out it was time to start doing conversions.

Martian datestamps are necessarily 64-bit integers; 32-bit ints only last about 70 (Earth) years. I created marsDate() to convey most of the functionality of PHP's date() function. The only real exception is the removal of twelve-horum time and the AM/PM that goes with it. Twenty-four-horum (military) time only, thanks. If we're going to recreate the clock we might as well do it right. I also created earthTsToMarsTs() to automatically take an Earth datestamp and add the appropriate amount to make it Martian.

As far as naming goes, some was easy and some wasn't. I opted for a seven-sol week and chose names for the sols based on the celestial bodies that are visible in the Martian sky. The week begins on Heliosol. (Helios being Greek for the Sun; at least five of the names are based on the Greek names. Two I'm not sure of.) The work week begins with Deimosol and Phobosol, after Mars's captured asteroids moons. Then on to the planets: Terrasol (Terra -- Earth), Aphrodisol (Aphrodite -- Venus) and Zeusol (Zeus -- Jupiter) even out the work week, and Cronosol (Cronos -- Saturn) begins the weekend. 1/1/0000 was a Heliosol.

Lunes I had a harder time with. The year begins with three people who were important in the study of Mars -- Percival (Lowell, who thought he saw canals), Asaph (Hall, discoverer of the moons) and Giovanni (Schiaparelli, who saw the canali that Lowell mistranslated as "canals".

Then I ran out of steam with only 15 to go. The fourth and fifth lunes are currently named (H.G.) Wells and (Edgar Rice) Burroughs who wrote The War of the Worlds and the Barsoom Series, respectively. I only half-seriously considered naming the thirteenth lune "Smarch" but a scholarly work such as this is no place for Simpsons references :)

Of course, my code is probably full of bugs like off-by-one errors: It's not like I have an actual calendar to check against. But it was a fun exercise. I probably ought to put it up on the site so people can play with it.

May 25, 2006May 29, 2006