LunarCalendar.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef __CALENDAREX_20160127__
  2. #define __CALENDAREX_20160127__
  3. #pragma once
  4. namespace CalendarEx
  5. {
  6. //保存一个农历日期;
  7. typedef struct _STLUNARDATE_
  8. {
  9. INT nYear;
  10. INT nMonth;
  11. INT nDay;
  12. bool bIsLeapMonth; //是否闰月;
  13. _STLUNARDATE_() {
  14. nYear = 0;
  15. nMonth = 0;
  16. nDay = 0;
  17. bIsLeapMonth = FALSE;
  18. }
  19. } LunarDate, *pLunarDate;
  20. // 农历日期有效性;
  21. BOOL IsValidLunanrDate(IN LPCTSTR lpLunarDate);
  22. // 农历日期有效性;
  23. BOOL IsValidLunanrDate(IN INT nLunarYear, IN INT nLunarMonth, IN INT nLunarDay);
  24. BOOL IsValidSolarStrDate(IN LPCTSTR lpSolarDate, IN BOOL bThisyear);
  25. BOOL IsValidSolarDate(
  26. IN CONST INT &nSolarYear,
  27. IN CONST INT &nSolarMonth,
  28. IN CONST INT &nSolarDay);
  29. INT DayOfSolarYear(
  30. IN CONST INT &nSolarYear,
  31. IN CONST INT &nSolarMonth,
  32. IN CONST INT &nSolarDay);
  33. INT SolarToLuanrDate(
  34. IN CONST INT &nSolarYear,
  35. IN CONST INT &nSolarMonth,
  36. IN CONST INT &nSolarDay,
  37. OUT LunarDate &lnaDate);
  38. INT GetLunarDate(
  39. IN CONST INT &nSolarYear,
  40. IN CONST INT &nSolarMonth,
  41. IN CONST INT &nSolarDay,
  42. OUT LPTSTR lpLunarDate);
  43. BOOL LuanrToSolarDate(
  44. IN CONST INT &nLunarYear,
  45. IN CONST INT &nLunarMonth,
  46. IN CONST INT &nLunarDay,
  47. OUT LPTSTR lpSolarDate,
  48. IN BOOL bIsLeapMonth = FALSE );
  49. INT IsLeapMonth(IN const INT &nLunarYear);
  50. };
  51. #endif