Date formatting yyyymmdd to yyyy-mm-dd
tdrDate = DateTime.ParseExact(dateString, "yyyyMMdd", null).ToString("yyyy-MM-dd");
You need MM, not mm. mm is for minutes.
It should be:
DateTime.ParseExact(dateString, "yyyyMMdd", null).ToString("yyyy-MM-dd");
Capital 'MM' in the first date format string.
"yyyymmdd"
must be "yyyyMMdd"
.
mm is for minutes.