手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

日历函数单元

来源:互联网 作者:西部数码 时间:2008-04-09
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

else
Result := (iMonth - 1) * 2 1
else
Result := 0;
end;

function GetLunarHolDay(InDate: TDateTime): string;
var
i, iYear, iMonth, iDay: Word;
begin
DecodeDate(InDate, iYear, iMonth, iDay);
i := l_GetLunarHolDay(iYear, iMonth, iDay);
case i of
1: Result := ''''小寒'''';
2: Result := ''''大寒'''';
3: Result := ''''立春'''';
4: Result := ''''雨水'''';
5: Result := ''''惊蛰'''';
6: Result := ''''春分'''';
7: Result := ''''清明'''';
8: Result := ''''谷雨'''';
9: Result := ''''立夏'''';
10: Result := ''''小满'''';
11: Result := ''''芒种'''';
12: Result := ''''夏至'''';
13: Result := ''''小暑'''';
14: Result := ''''大暑'''';
15: Result := ''''立秋'''';
16: Result := ''''处暑'''';
17: Result := ''''白露'''';
18: Result := ''''秋分'''';
19: Result := ''''寒露'''';
20: Result := ''''霜降'''';
21: Result := ''''立冬'''';
22: Result := ''''小雪'''';
23: Result := ''''大雪'''';
24: Result := ''''冬至'''';
else
Result := '''''''';
end;
end;

function GetLunarHolDay(iYear, iMonth, iDay: Word): string;
begin
Result := GetLunarHolDay(EncodeDate(iYear, iMonth, iDay));
end;

function GetConstellation(const DateTime: TDateTime): Integer;
var
Y, M, D: Word;
begin
DecodeDate(DateTime, Y, M, D);
Y := M * 100 D;
if (Y >= 321) and (Y <= 419) then
Result := 0
else
if (Y >= 420) and (Y <= 520) then
Result := 1
else
if (Y >= 521) and (Y <= 620) then
Result := 2
else
if (Y >= 621) and (Y <= 722) then
Result := 3
else
if (Y >= 723) and (Y <= 822) then
Result := 4
else
if (Y >= 823) and (Y <= 922) then
Result := 5
else
if (Y >= 923) and (Y <= 1022) then
Result := 6
else
if (Y >= 1023) and (Y <= 1121) then
Result := 7
else
if (Y >= 1122) and (Y <= 1221) then
Result := 8
else
if (Y >= 1222) or (Y <= 119) then
Result := 9
else
if (Y >= 120) and (Y <= 218) then
Result := 10
else
if (Y >= 219) and (Y <= 320) then
Result := 11
else
Result := -1;
end;

function GetConstellationName(const Constellation: Integer): string;
begin
case Constellation of
0: Result := ''''白羊座'''';
1: Result := ''''金牛座'''';
2: Result := ''''双子座'''';
3: Result := ''''巨蟹座'''';
4: Result := ''''狮子座'''';
5: Result := ''''处女座'''';
6: Result := ''''天秤座'''';
7: Result := ''''天蝎座'''';
8: Result := ''''射手座'''';
9: Result := ''''摩羯座'''';
10: Result := ''''水瓶座'''';
11: Result := ''''双鱼座'''';
else
Result := '''''''';
end;
end;

function GetConstellationName(const DateTime: TDateTime): string;
begin
Result := GetConstellationName(GetConstellation(DateTime));
end;

end.

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!