NAME
DateTime::Event::Chinese - DateTime Extension for Calculating Important Chinese Dates
SYNOPSIS
use DateTime::Event::Chinese;
my $new_moon = DateTime::Event::Chinese->new_year();
my $dt0 = DateTime->new(...);
my $next_new_year = $new_year->next($dt0);
my $prev_new_year = $new_year->previous($dt0);
my $dt1 = DateTime->new(...);
my $dt2 = DateTime->new(...);
my $span = DateTime::Span->new(start => $dt1, end => $dt2);
my $set = $new_year->intersection($span);
my $iter = $set->iterator();
while (my $dt = $iter->next) {
print $dt->datetime, "\n";
}
my $new_year = DateTime::Event::Chinese->new_year_for_sui(dateitme => $dt);
my $new_year = DateTime::Event::Chinese->new_year_for_gregorian_year(
datetime => $dt);
my $new_year = DateTime::Event::Chinese->new_year_after(datetime => $dt);
my $new_year = DateTime::Event::Chinese->new_year_before(datetime => $dt);
DESCRIPTION
This modules implements the algorithm described in "Calendrical Calculations" to compute some important Chinese dates, such as date of new year and other holidays (Currently only new years can be calculated).
FUNCTIONS
DateTime::Event::Chinese->new_year_for_sui(%args)
Returns the DateTime object representing the Chinese New Year for the "sui" (the period between two winter solstices) of the given date.
my $dt = DateTime::Event::Chinese->new_year_for_sui(
datetime => $dt0
);
DateTime::Event::Chinese->new_year_for_greogrian_year(%args)
Returns the DateTime object representing the Chinese New Year for the given gregorian year.
my $dt = DateTime::Event::Chinese->new_year_for_sui(
datetime => $dt0
);
DateTime::Event::Chinese->new_year_after(%args)
Returns a DateTime object representing the next Chinese New Year relative to the given datetime argument.
my $next_new_year = DateTime::Event::Lunar->new_year_after(datetime => $dt0);
This is the function that is internally used by new_year()->next().
DateTime::Event::Chinese->new_year_before(%args)
Returns a DateTime object representing the previous Chinese New Year relative to the given datetime argument.
my $prev_new_year = DateTime::Event::Lunar->new_year_beore(datetime => $dt0);
This is the function that is internally used by new_year()->previous().
AUTHOR
(c) Copyright 2004-2005 Daisuke Maki <daisuke@cpan.org>
REFERENCES
[1] Edward M. Reingold, Nachum Dershowitz
"Calendrical Calculations (Millenium Edition)", 2nd ed.
Cambridge University Press, Cambridge, UK 2002
SEE ALSO
DateTime DateTime::Set DateTime::Span DateTime::Event::Lunar DateTime::Event::SolarTerm