I am developing an asp.net web site, I want to convert a string of Persian date to DateTime type and I used below code but I get Gregorian date
System.Globalization.CultureInfo pr = new System.Globalization.CultureInfo("fa-ir");
DateTime dt = DateTime.ParseExact("1396/04/31", "yyyy/MM/dd", pr);
dt is 7/22/2017 but it must be 1396/04/31
I try this code too but have the same problem
PersianCalendar persianDate = new PersianCalendar();
DateTime st = persianDate.ToDateTime(1396, 04, 31, 0, 0, 0, 0);
I use windows 10 and .net 4.5
how can I resolve this problem. please help me.