AntFit

Bless, To make proper This is the first account, the first narrative. There was neither man, nor animal, birds, fishes, crabs, trees, stones, caves, ravines, grasses, nor forests; there was only the sky.

--The Popol Vuh, sacred book of the Quiche Maya.

In learning a new programming language, toolkit, or library, some people write "Hello, World". One I knew would write a hex dump utility. I calculate Mayan dates. Probably my very first real programming effort involved taking a Mayan date calculator written in FORTRAN and re-creating it in C. Since then I've rewritten it many times, and used the basic code as the core for implementing a prototype to learn new things, including web CGIs, servlets, Mozilla XPCOM, Web Services, and more. It was the natural choice for my foray into FIT.

The Mayans knew about 0 and counted in base 20. This page really can't do justice to the Mayan date system. Read more about Mayan calendar systems.

Unless otherwise noted, expected values are those generated with the Maya Long Count Date Generator

If you are interested in duplicating these results in your own code, you'll want to get a good reference on basic date conversions. Start by generating Julian day from a Gregorian calendar date. Use the Julian day to generate the Mayan dates. Probably the best technical reference on the web is at Maya World Studies Center.

Here is the input document

com.cmdev.maya.MayaFixture
gregorianDate correlationConstant round() longCount() julian()
June 30, 1964 584283 4 Ix 17 Zotz 12 . 17 . 10 . 14 . 14 2438577
June 30, 1964 584285 2 Eb 15 Zotz 12 . 17 . 10 . 14 . 12 2438577
December 21, 2012 584283 4 Ahau 3 Kankin 13 . 0 . 0 . 0 . 0 2456283

com.cmdev.maya.MayaFixture
julianDate correlationConstant round() longCount() gregorian()
2369916 584283 9 Ben 16 Uo 12 . 8 . 0 . 1 . 13 July 4, 1776
2299161 584283 13 Etznab 11 Tzec 11 . 18 . 3 . 9 . 18 October 15, 1582

fit.Summary

A clean run should result in the following

com.cmdev.maya.MayaFixture
gregorianDate correlationConstant round() longCount() julian()
June 30, 1964 584283 4 Ix 17 Zotz 12 . 17 . 10 . 14 . 14 2438577
June 30, 1964 584285 2 Eb 15 Zotz 12 . 17 . 10 . 14 . 12 2438577
December 21, 2012 584283 4 Ahau 3 Kankin 13 . 0 . 0 . 0 . 0 2456283

com.cmdev.maya.MayaFixture
julianDate correlationConstant round() longCount() gregorian()
2369916 584283 9 Ben 16 Uo 12 . 8 . 0 . 1 . 13 July 4, 1776
2299161 584283 13 Etznab 11 Tzec 11 . 18 . 3 . 9 . 18 October 15, 1582

fit.Summary
counts 15 right, 0 wrong, 0 ignored, 0 exceptions
input file /home/sen/src/antfit/fitdocs/MayanCalendar.html
input update Sat Apr 26 19:14:50 PDT 2003
output file /home/sen/src/antfit/build/tests/MayanCalendar.html
run date Sat Apr 26 19:29:36 PDT 2003
run elapsed time 0:00.04