Comparison between the lunar calendar and the Gregorian Calendar

Source: Internet
Author: User

Many people want to find their own calendars. For this very simple problem, Perpetual calendar is also very difficult for friends who do not frequently access the internet. I am determined to solve this problem.

Now I have written a Java applet that uses some existing resources on the Internet. You can directly enter your own calendar or calendar birthday, click "Submit" to see the date after the transformation. I hope it will be useful to you.

Http://three.freejsp.net/yuanqingfei/

 

Thanks http://www.freejsp.net /? Id = yuanqingfei provides space support

Sender: hjdwg (Xiaoyu), email area: MathTools
Title: Re: Who has the comparison between the lunar calendar and the Gregorian Calendar
Mailing site: BBS shuimu Tsinghua station (Sat May 31 21:20:25 2003)

Coincidentally, I used matlab to make one, and now I can paste it.
Function xx = LunarCalendar (y, m, d)
% Function xx = LunarCalendar (y, m, d)
%
% Lunar calendar query, adapted from JavaScript on a webpage. You are welcome to change it.
%
% Author: hjdwg@0451.com
If nargin = 0;
Cccc = clock;
Y = cccc (1); m = cccc (2); d = cccc (3 );
End
Animals = {'rat ', 'ox', 'tiger ', 'rabbit', 'Dragon ', 'snake', 'Ma', 'goat ', 'Monkey ', 'Chicken ', 'Dog', 'pig '};
SolarTerm = {'slight cold ', 'Big cold', 'early spring ', 'rain', 'stunned', 'spring equinox ',...
'Clearly', 'Grain rain', 'summer up', 'Grain man', 'Grain Mountain ', 'summer solstice ',...
'Summer heat ', 'summer heat', 'autumn heat ', 'summer heat', 'White dew ', 'autumn equinox ',...
'Cold dew ', 'frost down', 'Winter', 'light snow', 'Sleep Day '};
CnDayStr = {'1st day ', '2nd day', '3rd day ', '4th day', '5th day ',...
'6', '7', '8', '9', '10 ',...
'11', '12', '13', '14', '15 ',...
'16', '17', '18', '19', '20 ',...
'Allow yi', 'Allow 2', 'Allow 3', 'Allow 4', 'Allow 5 ',...
'Sixty-six ', 'sixty-seven', 'sixty-eight ', 'sixty-nine', 'Thirty '};
CnMonthStr = {'position', '2', '3', '4', '5', '6', '7', '8', '9 ', '10', 'dong', 'La '};
MonthName = {'Jan ', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep ', 'oct', 'nov', 'dec '};

LunarInfo = [19416,19168, 42352,21717, 53856,55632, 91476,22176, 41532,21970 ,...
19168,22,42192,53840, 119381,46400, 54944,44450, 38320,84343 ,...
18800,42160, 46261,27216, 27968,425396, 11104,38256, 21234,18800 ,...
25958,54432, 59984,28309, 23248,11104, 100067,37600, 116951,51536 ,...
54432,120998, 46416,22176, 107956,9680, 37584,53938, 43344,46423 ,...
27808,46416, 86869,19872, 11648,83315, 21200,43432, 59728,27296 ,...
44710,43856, 19296,43748, 42352,21088, 62051,55632, 23383,22176 ,...
Listen 8, 19925, 19152,42192, 54484,53840, 54616,46400, 46496,103846 ,...
38320,18864, 43380,42160, 45690,27216, 27968,44870, 43872,38256 ,...
,...
51552,55636, 54432,55888, 30034,22176, 43959,9680, 37584,51893 ,...
43344,46240, 47780,44368, 21977,19360, 42516,86390, 21168,43312 ,...
,...
, 30371 ,...
46496, 22385, 21938,18864, 42359,42160, 43600,1189, 27936,44448];

LYearDays = [384,354,355,383,354,355,384,354,355,384 ,...
354,384,354,354,384,354,355,384,355,384 ,...
354,354,384,354,354,385,354,355,384,354 ,...
383,354,355,384,355,354,384,354,384,354 ,...
354,384,355,354,385,354,354,384,354,384 ,...
354,355,384,354,355,384,354,383,355,354 ,...
384,355,354,384,355,353,384,355,384,354 ,...
355,384,354,354,384,354,384,354,355,384 ,...
355,354,384,354,384,354,354,384,355,355 ,...
384,354,354,383,355,384,354,355,384,354 ,...
354,384,354,355,384,354,385,354,354,384 ,...
354,354,384,355,384,354,355,384,354,354 ,...
384,354,355,384,354,384,354,354,384,355 ,...
354,384,355,384,354,354,384,354,354,384 ,...
355,355,384,354,384,354,354,384,354,355];

LeapDays = [, 0 ,...
, 30, 0 ,...
,...
29,0 ,...
,...
0, 0, 30, 0, 0, 29, 0 ,...
29,0 ,...
,...
,...
29,0 ,...
,...
,...
29,0 ,...
,...
,];

LeapMonth = ,...
,...
,...
6, 0 ,...
,...
,...
6, 0 ,...
,...
0, 0, 4, 0, 0, 0, 6, 0 ,...
5, 0 ,...
,...
0, 0, 4, 0, 9, 0, 6, 0 ,...
,...
,...
,];

Offset = datenum (Y, M, d)-datenum (1900,1, 31) + 1;

Daycyl = offset + 40;
Moncyl = 14;

Cumlyeardays = cumsum ([0, lyeardays]);
Lunaryear = find (Offset> cumlyeardays );
Lunaryear = lunaryear (end );
Moncyl = moncyl + (LunarYear-1) * 12; yearcyl = lunaryear + 36;

Offset = offset-cumlyeardays (lunaryear );

Monthdays = [29,30];
MonthDays = monthDays (bitand (lunarInfo (LunarYear), bitshift (65536 )))~ = 0) + 1 );

Leap = leapMonth (LunarYear );
If leap,
MonthDays = [monthDays (1: leap), leapDays (LunarYear), monthDays (leap + 1: end)];
End
CumMonthDays = cumsum ([0, monthDays]);
LunarMonth = find (offset> cumMonthDays); LunarMonth = LunarMonth (end );
Offset = offset-cumMonthDays (LunarMonth );
Ch_run_ch = '';
If leap
If LunarMonth = (leap + 1), ch_run_ch = 'running'; end
If (LunarMonth> leap), LunarMonth = LunarMonth-1; end
End
MonCyl = monCyl + LunarMonth;
Xx = ['lunar calendar ', Animals {rem (yearCyl-1, 12) + 1}, 'Year', ch_run_ch, CnMonthStr {LunarMonth}, 'month', CnDayStr {offset}];
Xx = {xx; [logical ical (yearCyl), 'Year', logical ical (monCyl), 'month', logical (dayCyl), 'day']};
Return

Function ganzhi = semantic ical (num)
Gan = {'A', 'B', 'bing', 'ding', 'pente', 'ji ', 'geng', 'sin', 'taobao ', 'authorization '};
Zhi = {'Z', 'Ugly ', 'yin', 'mao ', 'chen', 'si ', 'wu', 'wei ', 'shen ', 'uni', 'shanghai', 'hai '};
Ganzhi = [Gan {rem (num-1, 10) + 1}, Zhi {rem (num-1, 12) + 1}];

[Mentioned in the masterpiece abcxyz2008 (wood :]
: Ladies and gentlemen, where is the comparison between the lunar calendar and the Gregorian calendar? I know the date of the Gregorian calendar of a certain day and want to know how much it is.
: Do? Where is calendar?

--

※Source: · BBS shuimu Tsinghua station smth.org · [FROM: 211.68.38.167]

By the way, let me introduce my birthday.

> LunarCalendar (1981,3, 23)

Ans =

'Lunar rooster, February 11'
'Xin younian Xin Mao Yue Geng Zi day'

 

 

<Script type = "text/JavaScript">
Alimama_pid = "mm_10100948_184213_219218 ";
Alimama_titlecolor = "0000FF ";
Alimama_descolor = "000000 ";
Alimama_bgcolor = "FFFFFF ";
Alimama_bordercolor = "E6E6E6 ";
Alimama_linkcolor = "008000 ";
Alimama_bottomcolor = "FFFFFF ";
Alimama_anglesize = "0 ";
Alimama_bgpic = "0 ";
Alimama_icon = "0 ";
Alimama_sizecode = "31 ";
Alimama_width = 180;
Alimama_height = 250;
Alimama_type = 2;
</Script>
<Script src = "http://a.alimama.cn/inf.js" type = text/javascript>
</Script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.