如何公历日期转换为波斯日期?

问题描述:

我要定制的公历日期转换为波斯日期在C#中。
为例,我有这样内容的字符串:

I want to convert a custom Gregorian date to Persian date in C#. For example, i have a string with this contents:

string GregorianDate = "Saturday, October 24, 2013";

现在我想有:

字符串PersianDate =پنجشنبه2آبان1392;

string PersianDate = پنج‌شنبه 2 آبان 1392 ;

字符串PersianDate = 1392年8月2日

string PersianDate = 1392/08/02

感谢

使用的PersianCalendar:

Use the PersianCalendar:

string GregorianDate = "Thursday, October 24, 2013";
DateTime d = DateTime.Parse(GregorianDate);
PersianCalendar pc = new PersianCalendar();
Console.WriteLine(string.Format("{0}/{1}/{2}", pc.GetYear(d), pc.GetMonth(d), pc.GetDayOfMonth(d)));



我改变了一天至周四,因为这是2013年10月,24日。

I changed the day to Thursday since that was the 24th of October, 2013.