日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

最简公历排八字的代码

發(fā)布時(shí)間:2024/3/24 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 最简公历排八字的代码 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

有更簡(jiǎn)單的,要告訴我幺
g1…g4年干月干日干時(shí)干,z1…z4地支
甲1…癸10,子1…亥12

procedure 確定GZ1_4;

begin
RiQi:= trunc ( Form1.DateTimePicker1.Date );
ShiJian := frac ( Form1.DateTimePicker2.Time );
decodedate(RiQi,XNian,Xyue, XRi);
decodeTime (ShiJian,XShi,XFen,XMiao,xx);

{g3 z3 z4 g4 確定 與節(jié)氣無(wú)關(guān)}g3:=trunc(RiQi-encodedate(1919,11,8))mod 10+1 ;z3:=trunc(RiQi-encodedate(1919,11,8))mod 12+1 ;z4:= Round(XShi/2+0.1)+1;//Round 四舍六入 +0.1if XShi=23 then //23 以后按下一天計(jì)算beginz4:=1; // z4 確定inc(g3);if g3=11 then g3:=1 ; // g3 最終確定inc(z3);if z3=13 then z3:=1 ; // z3 最終確定end ;g4 :=(g3*2+z4-2)mod 10;if g4=0 then g4:=10; // g4 最終確定

{g1 z1 z2 g2 暫時(shí)確定 與節(jié)氣有關(guān)}

g1:= (XNian-4 ) mod 10+ 1;
z1:= (XNian-4 ) mod 12+ 1;
if Xyue=1 then //1月是上一年的
begin
dec(g1);if g1=0 then g1:=10;
dec(z1);if z1=0 then z1:=12;
end;
z2:= Xyue +1;if z2=13 then z2:=1;

if compareDatetime(RiQi+ShiJian,本月節(jié)令)=-1 then
begin

dec(z2);if z2=0 then z2:=12;if Xyue=2 thenbegindec(g1);if g1=0 then g1:=10; //2 月 立春交節(jié) 以前修正為上年dec(z1);if z1=0 then z1:=12;end;end;{ 確定g2 }case z2 of3..12: g2:=(g1*2+z2-2)mod 10;1,2: g2:=(g1*2+z2-10)mod 10;end ; if g2=0 then g2:=10;

end ;

總結(jié)

以上是生活随笔為你收集整理的最简公历排八字的代码的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。