但是,您似乎实际上知道答案,但无论如何您都可以像这样将波斯语转换为儒略日期:
public static DateTime PersianDateToJulianDate(DateTime persianDate)
{
PersianCalendar pc = new PersianCalendar();
return new DateTime(persianDate.Year, persianDate.Month, persianDate.Day, pc);
}
public static DateTime JulianDateToPersianDate(DateTime persianDate)
{
PersianCalendar pc = new PersianCalendar();
return new DateTime(pc.GetYear(persianDate),
pc.GetMonth(persianDate),
pc.GetDayOfMonth(persianDate));
}
然后你可以像这样调用这些函数:
DateTime now = DateTime.Parse("1392/01/11");
DateTime julian = PersianDateToJulianDate(now); //convert to julian
DateTime persian = JulianDateToPersianDate(julian); //convert back again