Reputation: 1294
I have date value as string like 20200731
i have used to Below Code to Parse it with Exact date
Date.ParseExact(filenames.Substring(39,8).ToString(),"yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo)
Output of above Expression is 07/31/2020 00:00:00
, However i want to get output like 31-JUL-2020
Upvotes: 2
Views: 298
Reputation: 2705
Do you mean something like this?
Console.WriteLine(Strings.Format(Date.ParseExact("20200731", "yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo), "dd-MMM-yyyy").ToUpper)
Upvotes: 2