I\'m trying to convert a date in yyyymmdd format to yyyy-mm-dd with the following code:
tdrDate = DateTime.ParseExact(dateString, \"yyyymmdd\", null).ToStrin
Try this :
tdrDate = DateTime.ParseExact(dateString, "yyyyMMdd", null).ToString("yyyy-MM-dd");
use MM instead mm, mm is for minute & MM is for Month that is why it is taking 01 (default value of MM).