To convert from Gregorian date to Persian(Iranian) date: string GetPersianDateYear(string PersianDate) { return PersianDate.Substring(0, 4); } string GetPersianDateMonth(string PersianDate) { if (PersianDate.Trim().Length > 8 || PersianDate.IndexOf('/') > 0 || PersianDate.IndexOf('-'...
public DateTime ConvertPersianToEnglish(string persianDate) { string[] formats = { "yyyy/MM/dd", "yyyy/M/d", "yyyy/MM/d", "yyyy/M/dd" }; DateTime d1 = DateTime.ParseExact(persianDate, formats, CultureInfo.CurrentCulture, DateTimeStyles.None); PersianCalendar persian_date = new PersianCa...