I use the function below to convert Gregorian dates to Persian dates, but I\'ve been unable to write a function to do the reverse conversion. I want a function that converts
You may try with this:
using System.Globalization // namespace
GregorianCalendar greg = new GregorianCalendar();
DateTime DayYearMonth = new DateTime(1433, 10, 11, greg );
Console.WriteLine(greg .GetDayOfMonth(DayYearMonth )); // 11
Console.WriteLine(greg .GetYear(DayYearMonth )); // 1433
Console.WriteLine(greg .GetMonth(DayYearMonth )); // 10