I want to parse this date "27-Jun-2118". I don't know why my code is not parsing this date.
After looking around. I found out that it depends on Culture but I was unable to find out maximum date i can parse and more about culture.
string endDatep = "27-Jun-2118";
var provider = CultureInfo.InvariantCulture;
DateTime endDate;
var isEndDateParsed = DateTime.TryParseExact(endDatep, "dd-MMM-yyyy", provider, DateTimeStyles.None,out endDate);
I live in Pakistan.
Solution(not the reason)
Changing endDatep to Upper Case such that Jun becomes JUN solved the problem