Convert Date Time to Format : I am trying to convert a string which is "20151107" to a date format like this "2015-11-07".

Here's my code :

     public static DateTime CustomDateFormat(this string resultdate)
        {
            DateTime dt = DateTime.ParseExact(resultdate, "yyyyMMdd", CultureInfo.InvariantCulture);
            return dt;
        }

However this returns something like this "11/07/2015 00:00:00.00"

Any idea ? Thanks.