NAME

DateTime::Calendar::Mayan - The Mayan Long Count Calendar

SYNOPSIS

use DateTime::Calendar::Mayan
# 2003-04-01 UTC
my $dtcm = DateTime::Calendar::Mayan->new(
                   baktun  => 12,
                   katun   => 19,
                   tun     => 10,
                   uinal   => 2,
                   kin     => 8,
           );

print $dtcm->bktuk; 
# prints 12.19.10.2.8

DESCRIPTION

An implementation of the Mayan Long Count Calendar as defined in "Calendrical Calculations The Millennium Edition".

METHODS

  • new( %hash )

    Accepts a hash representing the number of days since the Mayan epoch.

    The units are:
    kin   = 1 day
    uinal = 20 days
    tun   = 360 days
    katun = 7200 days
    baktun = 144000 days

    In the future pictuns, calabtuns, kinchiltuns, and alautuns may be accepted.

  • now

    Alternate constructor. Uses DateTime->now to set the current date.

  • from_object( object => $object, ... )

    Accepts a "DateTime::Calendar" object. Although this calendar doesn't support time it will preserve the time value of objects passed to it. This prevents a loss of precision when chaining calendars.

    Note: Language support is not implemented.

  • utc_rd_values

    Returns the current UTC Rata Die days and seconds as a two element list.

  • bktuk( $str )

    Think DateTime::ymd. Like ymd this method also accepts an optional field separator string.

  • date

    Aliased to bktuk.

  • baktun

  • katun

  • tun

  • uinal

  • kin( $str )

    Gets/Sets the long count value of the function name.

  • set( %hash )

    Accepts a hash specifying new long count values. All units are optional.

  • add

  • subtract( %hash )

    Accepts a hash specifying values to add or subject from the long count. All units are optional.

BACKGROUND

TODO :)

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)

SUPPORT

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

AUTHOR

Joshua Hoblitt <jhoblitt@cpan.org>

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.

SEE ALSO

datetime@perl.org mailing list

http://datetime.perl.org/