DateTime::Calendar::Mayan - The Mayan Long Count, Haab, and Tzolkin calendars


NAME

DateTime::Calendar::Mayan - The Mayan Long Count, Haab, and Tzolkin calendars

Back to Top


SYNOPSIS


   use DateTime::Calendar::Mayan
   my $dtcm = DateTime::Calendar::Mayan->new(
        baktun  => 12,
        katun   => 19,
        tun     => 10,
        uinal   => 2,
        kin     => 8,
        # alternate epoch
        epoch   => DateTime->new(
                year    => -3113,
                month   => 8,
                day     => 13,
            ),
    );
   print $dtcm->date; 
   # prints 12.19.10.2.8
   print $dtcm->haab; 
   # prints 3 Uayeb
   print $dtcm->tzolkin; 
   # prints 3 Oc

Back to Top


DESCRIPTION

An implementation of the Mayan Long Count, Haab, and Tzolkin calendars as defined in "Calendrical Calculations The Millennium Edition". Supplemented by "Frequently Asked Questions about Calendars".

Back to Top


METHODS

Back to Top


BACKGROUND

Please see:

Chapter 10 of Calendarical Calculations "The Millennium Edition".

and

Chapter 7 of Frequently Asked Questions about Calendars. http://www.tondering.dk/claus/cal/node8.html

Back to Top


GOTCHAS

The Long Count calendar is cyclical and it is possible to have different dates in other calendars that convert to be the same Long Count date. Under this calendar the dates 0.0.0.0.0 and 13.0.0.0.0 are equivalent.

The Long Count calendar will next roll over in late 2012 (Gregorian). In anticipation of this Long Count dates input as 0-12.*.*.*.* will convert to Gregorian dates in the Mayan year that started in -3113 (Gregorian). Long Count dates input as 13.*.*.*.* will convert to Gregorian dates in the Mayan year that start in 2012 (Gregorian).

Example:

   use DateTime;
   use DateTime::Calendar::Mayan;
   my $dtcm = DateTime::Calendar::Mayan->new( baktun => 0 );
   print $dtcm->date, "\n";
   print DateTime->from_object( object => $dtcm )->ymd, "\n";
   $dtcm->set( baktun => 13);
   print $dtcm->date, "\n";
   print DateTime->from_object( object => $dtcm )->ymd, "\n";

Will print:

   13.0.0.0.0
   -3113-08-11
   13.0.0.0.0
   2012-12-21

As you can see the Long Count dates are identical but the Gregorian equivalent dates are different.

Support for a count of Mayan "years" or "cycles" allowing accurate conversion to/from Gregorian dates may be added to this module in the future. This would be an extension to the historical Long Count calendar.

Back to Top


CREDITS

Dave Rolsky (DROLSKY) for the DateTime project and carrying us this far.

Eugene van der Pijll (PIJLL) for DateTime::Calendar::Julian which I looked at more then once.

Calendrical Calculations "The Millennium Edition" By Edward M. Reingold & Nachum Dershowitz. (ISBN 0-521-77752-6 paperback) http://www.calendarists.com

Abigail (ABIGAIL) for Date::Maya from which I confirmed the algorithm for Mayan years.

"Frequently Asked Questions about Calendars" by Claus Tøndering. http://www.tondering.dk/claus/calendar.html

Back to Top


SUPPORT

Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.

Back to Top


AUTHOR

Joshua Hoblitt <jhoblitt@cpan.org>

Back to Top


COPYRIGHT


Copyright (c) 2003 Joshua Hoblitt.  All rights reserved.  This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

Back to Top


SEE ALSO

datetime@perl.org mailing list

http://datetime.perl.org/

Back to Top

 DateTime::Calendar::Mayan - The Mayan Long Count, Haab, and Tzolkin calendars