📄 datecn.pas
字号:
result := '植树节(孙中山纪念日(复活节))';
If day = 14 Then
result := '国际警察日';
If day = 15 Then
result := '世界消费者权益日';
If day = 17 Then
result := '中国国医节(国际航海日)';
If day = 20 Then
result := '龙抬头节';
If day = 21 Then
result := '世界森林日(世界儿歌日)';
If day = 22 Then
result := '世界水日';
If day = 23 Then
result := '世界气象日';
If day = 24 Then
result := '世界防治结核病日';
If day = 25 Then
result := '全国中小学生安全教育日';
If day = 30 Then
result := '巴勒斯坦国土日';
End;
4:
Begin
If day = 1 Then
result := '愚人节(全国爱国卫生运动月(税收宣传月))';
If day = 7 Then
result := '世界卫生日';
If day = 22 Then
result := '世界地球日';
If day = 23 Then
result := '世界图书和版权日';
If day = 24 Then
result := '亚非新闻工作者日';
End;
5:
Begin
If day = 1 Then
result := '国际劳动节';
If day = 4 Then
result := '中国五四青年节';
// 母亲节[第二个星期日]
dDate := EnCodeDate(Year(Date), Month(Date), Day);
If (DayOfWeek(dDate) = 1) Then
If (Trunc((Day - 1) / 7) = 1) Then
result := '国际母亲节';
If day = 5 Then
result := '全国碘缺乏病防治日';
If day = 8 Then
result := '世界红十字日';
If day = 9 Then
result := '妈祖生辰(天上圣母诞辰)';
If day = 12 Then
result := '国际护士节';
If day = 15 Then
result := '国际家庭日';
If day = 17 Then
result := '世界电信日';
If day = 18 Then
result := '国际博物馆日';
If day = 19 Then
result := '全国助残日';
If day = 20 Then
result := '全国学生营养日(全国助残日)';
If day = 22 Then
result := '国际生物多样性日';
If day = 23 Then
result := '国际牛奶日';
If day = 31 Then
result := '世界无烟日';
End;
6:
Begin
If day = 1 Then
result := '国际儿童节';
// 父亲节[第三个星期日]
dDate := EnCodeDate(Year(Date), Month(Date), Day);
If (DayOfWeek(dDate) = 1) Then
If (Trunc((Day - 1) / 7) = 2) Then
result := '父亲节';
If day = 5 Then
result := '世界环境日';
If day = 6 Then
result := '全国爱眼日';
If day = 17 Then
result := '防治荒漠日和干旱日';
If day = 23 Then
result := '国际奥林匹克日';
If day = 25 Then
result := '全国土地日';
If day = 26 Then
result := '国际反毒品日';
End;
7:
Begin
If day = 1 Then
result := '香港回归纪念日(中国共产党建党日 世界建筑日)';
If day = 2 Then
result := '国际体育记者日';
If day = 7 Then
result := '七七事变(中国人民抗日战争纪念日)';
If day = 11 Then
result := '世界人口日';
If day = 30 Then
result := '非洲妇女日';
End;
8:
Begin
If day = 1 Then
result := '中国建军节';
If day = 8 Then
result := '中国男子节(爸爸节)';
If day = 15 Then
result := '日本正式宣布无条件投降日';
If day = 27 Then
result := '中元节';
End;
9:
Begin
If day = 3 Then
result := '抗日战争胜利纪念日';
If day = 8 Then
result := '国际扫盲日(国际新闻工作者日)';
If day = 9 Then
result := '毛泽东逝世纪念日';
If day = 10 Then
result := '教师节';
If day = 14 Then
result := '世界清洁地球日';
If day = 16 Then
result := '国际臭氧层保护日';
If day = 17 Then
result := '国际和平日(甲午战争1894年)';
If day = 18 Then
result := '国耻日(九一八事变纪念日)';
If day = 20 Then
result := '国际爱牙日';
If day = 22 Then
result := '国际聋人节(世界儿童日)';
If day = 27 Then
result := '世界旅游日';
If day = 28 Then
result := '孔子诞辰';
If day = 30 Then
result := '世界海事日';
End;
10:
Begin
If day = 1 Then
result := '国庆(国际音乐)节';
If day = 2 Then
result := '国际和平与民主自由斗争日';
If day = 3 Then
result := '国际减轻自然灾害日(减灾日)';
If day = 4 Then
result := '世界动物日';
If day = 6 Then
result := '老人节';
If day = 7 Then
result := '国际住房日';
If day = 8 Then
result := '全国高血压(世界视觉)日';
If day = 9 Then
result := '世界邮政日(万国邮联日)';
If day = 10 Then
result := '世界精神卫生日(辛亥革命纪念日)';
If day = 13 Then
result := '世界保健日(国际教师节)';
If day = 14 Then
result := '世界标准日';
If day = 15 Then
result := '国际盲人节(白手杖节)';
If day = 16 Then
result := '世界粮食日';
If day = 17 Then
result := '世界消除贫困日';
If day = 22 Then
result := '世界传统医药日';
If day = 24 Then
result := '联合国日(世界发展信息日)';
If day = 31 Then
result := '万圣节(世界勤俭日)';
End;
11:
Begin
// 感恩节(11月的第四个星期四 )
dDate := EnCodeDate(Year(Date), Month(Date), Day);
If (DayOfWeek(dDate) = 5) Then
If (Trunc((Day - 1) / 7) = 3) Then
result := '感恩节';
If day = 7 Then
result := '十月社会主义革命纪念日';
If day = 8 Then
result := '中国记者日';
If day = 9 Then
result := '全国消防安全宣传教育日';
If day = 10 Then
result := '世界青年节';
If day = 11 Then
result := '国际科学与和平周';
If day = 12 Then
result := '孙中山诞辰纪念日';
If day = 14 Then
result := '世界糖尿病日';
If day = 17 Then
result := '国际大学生节(世界学生节)';
If day = 21 Then
result := '世界问候日(世界电视日)';
If day = 3 Then
result := '国际声援巴勒斯坦人民国际日';
End;
12:
Begin
If day = 1 Then
result := '世界艾滋病日';
If day = 3 Then
result := '世界残疾人日';
If day = 5 Then
result := '国际经济和社会发展志愿人员日';
If day = 8 Then
result := '国际儿童电视日';
If day = 9 Then
result := '世界足球日';
If day = 10 Then
result := '世界人权日';
If day = 12 Then
result := '西安事变纪念日';
If day = 13 Then
result := '南京大屠杀(1937年)纪念日 紧记血泪史';
If day = 20 Then
result := '澳门回归纪念日';
If day = 21 Then
result := '国际蓝球日';
If day = 24 Then
result := '平安夜';
If day = 25 Then
result := '圣诞节';
If day = 26 Then
result := '毛泽东诞辰纪念日';
If day = 29 Then
result := '国际生物多样性日';
End;
End;
End;
Function GetCnDateToDate(dDate: TDateTime): TDateTime;
Begin
Result := GetCnDateToDate(Year(Now), CnMonth(dDate), CnDay(dDate));
End;
Function GetCnDateToDate(cYear, cMonth, cDay: word): TDateTime;
Var
tempDate: TDateTime;
tempDay, tempMonth: Integer;
Begin
If cMonth > 11 Then
tempDate := EnCodeDate(cYear - 1, cMonth, cDay)
Else
tempDate := EnCodeDate(cYear, cMonth, cDay);
Result := 0;
tempMonth := 0;
tempDay := 0;
While Result = 0 Do
Begin
tempDate := tempDate + 1;
If CnMonth(tempDate) = cMonth Then
If CnDay(tempDate) = cDay Then
Begin
Result := tempDate;
exit;
End
Else
If (cDay = 30) And (CnDay(tempDate) = 29)
And (CnDay(tempDate + 1) <> 30) Then
Begin
//如果是没有30(闰月),就提前一天
Result := tempDate;
exit;
End;
End;
End;
Function GetDays(ADate: TDate): Extended;
Var
FirstOfYear: TDateTime;
Begin
FirstOfYear := EncodeDate(StrToInt(FormatDateTime('yyyy', now)) - 1, 12, 31);
Result := ADate - FirstOfYear;
End;
Function Constellation(Date: TDateTime; Day: integer): String; overload;
Var
Year, Month, Days, Hour: Word;
Begin
DecodeDate(Date, Year, Month, Days);
Result := Constellation(EncodeDate(Year, Month, Day));
end;
Function Constellation(ADate: TDate): String;
Begin
Case Month(ADate) Of
1:
Begin
If day(ADate) <= 19 Then
result := '摩羯座';
If day(ADate) >= 20 Then
result := '水瓶座';
End;
2:
Begin
If day(ADate) <= 18 Then
result := '水瓶座';
If day(ADate) >= 19 Then
result := '双鱼座';
End;
3:
Begin
If day(ADate) <= 20 Then
result := '双鱼座';
If day(ADate) >= 21 Then
result := '白羊座';
End;
4:
Begin
If day(ADate) <= 19 Then
result := '白羊座';
If day(ADate) >= 20 Then
result := '金牛座';
End;
5:
Begin
If day(ADate) <= 20 Then
result := '金牛座';
If day(ADate) >= 21 Then
result := '双子座';
End;
6:
Begin
If day(ADate) <= 21 Then
result := '双子座';
If day(ADate) >= 22 Then
result := '巨蟹座';
End;
7:
Begin
If day(ADate) <= 22 Then
result := '巨蟹座';
If day(ADate) >= 23 Then
result := '狮子座';
End;
8:
Begin
If day(ADate) <= 22 Then
result := '狮子座';
If day(ADate) >= 24 Then
result := '处女座';
End;
9:
Begin
If day(ADate) <= 22 Then
result := '处女座';
If day(ADate) >= 23 Then
result := '天秤座';
End;
10:
Begin
If day(ADate) <= 23 Then
result := '天秤座';
If day(ADate) >= 24 Then
result := '天蝎座';
End;
11:
Begin
If day(ADate) <= 21 Then
result := '天蝎座';
If day(ADate) >= 22 Then
result := '射手座';
End;
12:
Begin
If day(ADate) <= 21 Then
result := '射手座';
If day(ADate) >= 22 Then
result := '摩羯座';
End;
End;
End;
{
//存储星座配信息
1白羊座: 03月21日-------04月19日 Aries
2金牛座: 04月20日-------05月20日 Taurus
3双子座: 05月21日-------06月21日 Gemini
4巨蟹座: 06月22日-------07月22日 Cancer
5狮子座: 07月23日-------08月22日 Leo
6处女座: 08月23日-------09月22日 Virgo
7天秤座: 09月23日-------10月23日 Libra
8天蝎座: 10月24日-------11月21日 Scorpio
9射手座: 11月22日-------12月21日 Sagittarius
10摩羯座: 12月22日-------01月19日 Capricorn
11水瓶座: 01月20日-------02月18日 Aquarius
12双鱼座: 02月19日-------03月20日 Pisces
}
End.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -