【发布时间】:2019-07-14 20:22:45
【问题描述】:
如何在C#中将公历转换为科普特历??
我有以下代码:
public enum CopticMonth
{
Thout = 1,
Paopi = 2,
Hathor = 3,
Koiak = 4,
Tobi = 5,
Meshir = 6,
Paremhat = 7,
Parmouti = 8,
Pashons = 9,
Paoni = 10,
Epip = 11,
Mesori = 12,
PiKogiEnavot = 13
}
public class CopticDate
{
public int Day { get; set; }
public CopticMonth Month { get; set; }
public int Year { get; set; }
}
我需要实现以下方法
public static CopticDate ToCopticDate(this DateTime date)
{
//...
}
【问题讨论】:
-
.NET 中最复杂的日期/时间问题的答案通常是“Noda Time”。我搜了一下,果然支持科普特日历:nodatime.org/2.2.x/userguide/calendars
标签: c# .net date calendar gregorian-calendar