Program.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Masuit.Tools.DateTimeExt;
  2. using System;
  3. namespace Test
  4. {
  5. internal static class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. //DateTime dt = DateTime.Parse("2019-2-6");
  10. //ChineseCalendar.SolarHolidayInfo.Add(new DateInfoStruct(12, 31, 1, "元旦"));
  11. //ChineseCalendar cc = new ChineseCalendar(dt);
  12. //Console.WriteLine("阳历:" + cc.DateString);
  13. //Console.WriteLine("属相:" + cc.AnimalString);
  14. //Console.WriteLine("农历:" + cc.ChineseDateString);
  15. //Console.WriteLine("时辰:" + cc.ChineseHour);
  16. //Console.WriteLine("节气:" + cc.ChineseTwentyFourDay);
  17. //Console.WriteLine("节日:" + cc.DateHoliday);
  18. //Console.WriteLine("农历节日:" + cc.ChineseCalendarHoliday);
  19. //Console.WriteLine("前一个节气:" + cc.ChineseTwentyFourPrevDay);
  20. //Console.WriteLine("后一个节气:" + cc.ChineseTwentyFourNextDay);
  21. //Console.WriteLine("干支:" + cc.GanZhiDateString);
  22. //Console.WriteLine("星期:" + cc.WeekDayStr);
  23. //Console.WriteLine("星宿:" + cc.ChineseConstellation);
  24. //Console.WriteLine("星座:" + cc.Constellation);
  25. //Console.WriteLine("是否是假期:" + cc.IsHoliday);
  26. //Console.WriteLine("是否是工作日:" + cc.IsWorkDay);
  27. DateTime today = DateTime.Parse("2019-1-1");
  28. var cc = new ChineseCalendar(today);
  29. var ccEnd = cc.AddWorkDays(30);
  30. var endDate = ccEnd.Date;
  31. Console.WriteLine((endDate - today).TotalDays);
  32. }
  33. }
  34. }