Date-Maya

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

        - t
        - inc
generated_by:       ExtUtils::MakeMaker version 6.56
meta-spec:
    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
    version:  1.4
keywords:
    - dates
    - date
    - Maya
    - calendar
test_requires:
    strict:    0
    warnings:  0

Makefile.PL  view on Meta::CPAN

    AUTHOR               =>  'Abigail <date-maya@abigail.be>',
    LICENSE              =>  'mit',
    META_MERGE           => {
        test_requires    => {
            'strict'             => 0,
            'warnings'           => 0,
        },
        resources        => {
            repository   =>  'git://github.com/Abigail/date--maya.git',
        },
        keywords         => [qw [dates date Maya calendar]],
    },
);

$args {META_MERGE} {build_requires} ||= {
    'ExtUtils::MakeMaker' =>  0,
    %{$args {META_MERGE} {test_requires}}
};

$args {META_MERGE} {configure_requires} ||=
    $args {META_MERGE} {build_requires};

README  view on Meta::CPAN

    Date::Maya -- Translate between Julian days and Maya days.

SYNOPSIS
        use Date::Maya;

        my  $long_count             = julian_to_maya 2451432;
        my ($long, $tzolkin, $haab) = julian_to_maya 2451432;
        my  $julian                 = maya_to_julian '12.19.6.9.9';

DESCRIPTION
    For an extensive description of both the Maya calendar and Julian days,
    see the calendar faq [1].

    This module presents routines to calculate the Mayan day from a Julian
    day, and a Julian day from a Mayan day. The Mayan calendar has different
    dating systems, the Long Count (which cycles every 5125 years), the
    Tzolkin (260 days) and the Haab (365 days). The Long Count consists of
    quintuple of numbers (really a mixed base 20/18 number), while the
    Tzolkin and the Haab consist of day numbers and week or month names. In
    the Tzolkin, both the week number and week name change from day to day;
    the week number cycles through 1 to 13, while there are 20 week names to
    cycle through. This gives a period of 260 days. The Haab has 18 months,
    of each 20 days, numbered 0 to 19. A new month is only started after
    reaching day 19. At the end of the 360 days, there are 5 Uayeb days. In
    the Long Count, all the numbers of the quintuple are 0 to 19 or 0 to 17,

README  view on Meta::CPAN

    with 13 serving as 0.

    By default, Date::Maya exports two subroutines, "julian_to_maya" and
    "maya_to_julian". "julian_to_maya" takes a Julian day as argument, and
    returns the Long Count date in scalar context. In list context, it
    returns the Long Count date, the Tzolkin date, and the Haab date.
    "maya_to_julian" takes a Long Count date as argument, and returns a
    Julian day.

  EPOCH AND ROLL OVER
    It is unclear when the epoch of the Mayan calendar occurred. Three dates
    are mentioned as candidates, 13 Aug 3114 BC, 11 Aug 3114 BC, and
    15 Oct 3374 BC. Unless changed, this module assumes 13 Aug 3114 as the
    epoch.

    To change the epoch, import the function "maya_epoch", and call it with
    the Julian date that should be the epoch. Constants "MAYA_EPOCH1",
    "MAYA_EPOCH2" and "MAYA_EPOCH3" can be imported, which will have the
    Julian days for 13 Aug 3114 BC, 11 Aug 3114 BC, and 15 Oct 3374 BC as
    values. The three constants can be imported at once by using the
    ":MAYA_EPOCH" tag.

    The Mayan calendar is cyclic, with a period of just over 5125 years.
    This means that if the epoch was in Aug 3114 BC, the calendar will roll
    over in Dec 2012 AD. If the epoch was in 3374 BC, the roll over has
    occured over 200 years ago. Since the calendar is cyclic, the
    "maya_to_julian" function is not unique. We will however return only one
    date, and that is the first Julian day matching the Long Count date on
    or after the choosen epoch.

    The Mayan Long Count calendar rolls over after 1872000 days.

REFERENCES
    [1] Tondering, Claus: *FREQUENTLY ASKED QUESTIONS ABOUT CALENDARS*
        http://www.pip.dknet.dk/%7Ec-t/calendar.html

SEE ALSO
    Sources are on github: <git://github.com/Abigail/date--maya.git>.

    DateTime::Calendar::Mayan is a plugin for the "DateTime" framework.

AUTHOR
    This package was written by Abigail, <mailto:date-maya@abigail.be>.

COPYRIGHT AND LICENSE

lib/Date/Maya.pm  view on Meta::CPAN

=head1 SYNOPSIS

    use Date::Maya;

    my  $long_count             = julian_to_maya 2451432;
    my ($long, $tzolkin, $haab) = julian_to_maya 2451432;
    my  $julian                 = maya_to_julian '12.19.6.9.9';

=head1 DESCRIPTION

For an extensive description of both the Maya calendar and Julian days,
see the calendar faq [1].

This module presents routines to calculate the Mayan day from a Julian
day, and a Julian day from a Mayan day. The Mayan calendar has different
dating systems, the Long Count (which cycles every 5125 years), the
Tzolkin (260 days) and the Haab (365 days). The Long Count consists
of quintuple of numbers (really a mixed base 20/18 number), while the
Tzolkin and the Haab consist of day numbers and week or month names. In
the Tzolkin, both the week number and week name change from day to day;
the week number cycles through 1 to 13, while there are 20 week names to
cycle through. This gives a period of 260 days. The Haab has 18 months,
of each 20 days, numbered 0 to 19. A new month is only started after
reaching day 19. At the end of the 360 days, there are 5 Uayeb days. In
the Long Count, all the numbers of the quintuple are 0 to 19 or 0 to 17,

lib/Date/Maya.pm  view on Meta::CPAN

with 13 serving as 0.

By default, Date::Maya exports two subroutines, C<julian_to_maya> and
C<maya_to_julian>. C<julian_to_maya> takes a Julian day as argument, and
returns the Long Count date in scalar context. In list context, it returns
the Long Count date, the Tzolkin date, and the Haab date. C<maya_to_julian>
takes a Long Count date as argument, and returns a Julian day.

=head2 EPOCH AND ROLL OVER

It is unclear when the epoch of the Mayan calendar occurred. Three dates
are mentioned as candidates, S<13 Aug 3114 BC>, S<11 Aug 3114 BC>, and
S<15 Oct 3374 BC>. Unless changed, this module assumes S<13 Aug 3114> as
the epoch.

To change the epoch, import the function C<maya_epoch>, and call it with the
Julian date that should be the epoch. Constants C<MAYA_EPOCH1>, C<MAYA_EPOCH2>
and C<MAYA_EPOCH3> can be imported, which will have the Julian days for
S<13 Aug 3114 BC>, S<11 Aug 3114 BC>, and S<15 Oct 3374 BC> as values.
The three constants can be imported at once by using the C<:MAYA_EPOCH> tag.

The Mayan calendar is cyclic, with a period of just over 5125 years. This
means that if the epoch was in S<Aug 3114 BC>, the calendar will roll over
in S<Dec 2012 AD>. If the epoch was in S<3374 BC>, the roll over has occured
over 200 years ago. Since the calendar is cyclic, the C<maya_to_julian> function
is not unique. We will however return only one date, and that is the first
Julian day matching the Long Count date on or after the choosen epoch.

The Mayan Long Count calendar rolls over after 1872000 days.

=head1 REFERENCES

=over 4

=item [1]

Tondering, Claus: I<FREQUENTLY ASKED QUESTIONS ABOUT CALENDARS>
L<< http://www.tondering.dk/claus/calendar.html >>

=back

=head1 SEE ALSO

Sources are on github: L<< git://github.com/Abigail/date--maya.git >>.

L<< DateTime::Calendar::Mayan >> is a plugin for the C<< DateTime >>
framework.



( run in 0.740 second using v1.01-cache-2.11-cpan-5dc5da66d9d )