?? datecn.pas
字號:
If day = 11 Then
result := '人口日';
End;
8:
Begin
End;
9:
Begin
If day = 8 Then
result := '掃盲日';
If day = 17 Then
result := '和平日';
If day = 20 Then
result := '愛牙日';
If day = 22 Then
result := '聾人節';
If day = 27 Then
result := '旅游日';
End;
10:
Begin
If day = 6 Then
result := '老人節';
If day = 4 Then
result := '動物日';
If day = 7 Then
result := '住房日';
If day = 9 Then
result := '郵政日';
If day = 15 Then
result := '盲人節';
If day = 16 Then
result := '糧食日';
End;
11:
Begin
If day = 8 Then
result := '記者日';
If day = 9 Then
result := '消防日';
If day = 17 Then
result := '大學生';
End;
12:
Begin
If day = 9 Then
result := '足球日';
If day = 24 Then
result := '平安夜';
End;
End;
End;
Function Holiday(Date: TDateTime; Day: integer): String;
Var
dDate: TDate;
Begin
result := '';
// result := OtherHoliday(Month(Date), Day);
Case Month(Date) Of
1:
Begin
If day = 1 Then
result := '元旦節';
End;
2:
Begin
If day = 14 Then
result := '情人節';
End;
3:
Begin
If day = 8 Then
result := '婦女節';
End;
4:
Begin
If day = 1 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 := '母親節';
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 := '父親節';
End;
7:
Begin
If day = 1 Then
result := '建黨節';
End;
8:
Begin
If day = 1 Then
result := '建軍節';
End;
9:
Begin
If day = 10 Then
result := '教師節';
End;
10:
Begin
If day = 1 Then
result := '國慶節';
If day = 6 Then
result := '老人節';
If day = 31 Then
result := '萬圣節';
End;
11:
Begin
If day = 8 Then
result := '記者日';
// 感恩節(11月的第四個星期四 )
dDate := EnCodeDate(Year(Date), Month(Date), Day);
If (DayOfWeek(dDate) = 5) Then
If (Trunc((Day - 1) / 7) = 3) Then
result := '感恩節';
End;
12:
Begin
If day = 25 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 + -