Date::Qreki - convert Gregorian to Japanese "kyureki" dates.
This documents Date::Qreki version 0.07 corresponding to git commit c07982b5dc1b3e61c395505faa297f717276a4e3 released on Tue Jan 31 12:11:14 2017 +0900.
This module contains functions related to the old Japanese lunar calendar. Convert Western dates to old Japanese lunar calendar dates with "calc_kyureki". Get the fortune-telling day with "get_rokuyou" or "rokuyou_unicode". Check if a date is a solar term with "check_24sekki".
@kyureki = calc_kyureki ($year, $mon, $day);
Given a western date, return the corresponding old Japanese calendar date. The return value is an array containing the following fields.
See the Wikipedia article on Intercalation for an explanation.
$rokuyou = get_rokuyou ($year,$mon,$day);
Get Japanese fortune telling day. Response is from 0 to 5 corresponding to kanji names 0:大安 1:赤口 2:先勝 3:友引 4:先負 5:仏滅. See also "rokuyou_unicode" for a version which returns the kanji names of the days.
my $rokuyou = rokuyou_unicode (2017, 1, 30);
This returns the kanji form of the rokuyou, which are six Japanese fortune telling days. The three arguments are year, month, and day in the modern calendar. This just calls "get_rokuyou" with the dates then returns a Unicode version of the date. See, for example, WWWJDIC for the meanings of each of these day names.
This function was added in version 0.07 of the module.
my $sekki = check_24sekki ($year, $month, $day);
Is today a Solar term? If today is a solar term, it returns the Japanese name of the solar term corresponding to the date given. The response is in character (utf8) format.
Nothing is exported by default. All of the functions can be exported using the tag ":all".
use Date::Qreki ':all';
Japanese era-based dates.
Older Japanese eras
Scan text to find dates in Japanese format.
Date::Qreki is copyright H. Takano, N. Ueno.
For the original licence, see "配布規定" in Date::Qreki-ja. The following is a translation of the licence.
(Translation by B. Bullock)
19 Conditions for redistribution
I would prefer to release this under the conditions of "whatever normal common sense allows", but since there are a variety of people in the world, unfortunately I think some form of framework is necessary. My wishes are as follows
i. If this script is redistributed, please also include all the original scripts, and do not modify the original script and its documentation. This also applies if the archive format (.arc, .zip, .zoo, etc.) is changed.
ii. I forbid any resale of this program beyond the cost of distribution media. (This also applies if the program is translated to a different programming language).
iii. If this is translated to a different programming language, or if part or all of this script is used as part of another program, please be sure to include the original script and this explanation with it. If part of this program is used, I retain the copyright of the quoted material only and the remaining program remains copyrighted by its author.
iv. Please do not allow the author of this software to be placed under any restrictions by your redistribution.
In any case, there is absolutely no need to obtain the author's consent or notify the author.
As required by the above licence, the original Awk script qreki.awk and its documentation qreki.doc are in the subdirectory originals in the distribution. These are text files in Shift-JIS format. To read them on a modern terminal, use something like
iconv -f CP932 -t UTF-8 originals/qreki.doc
or
perl -MEncode -n -e "print encode_utf8 (decode ('CP932', \$_));" < originals/qreki.doc
Web browsers also may or may not be able to render these files. Currently Google Chrome seems to be the only browser with Shift-JIS capabilities.
Original Awk script by H. Takano. Perl conversion by N. Ueno. This CPAN-ification of N. Ueno's Perl script was performed by Ben Bullock.
For enquiries about this Perl module, please contact Ben Bullock <bkb@cpan.org>.
To install Date::Qreki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Date::Qreki
CPAN shell
perl -MCPAN -e shell install Date::Qreki
For more information on module installation, please visit the detailed CPAN module installation guide.