Anyone please do suggest a expression
You can try with this expression
DateTime.ParseExact(StringInput.ToString,"MM/dd/yyyy hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy")
Regards
Gokul
Check out the another expression
DateTime.ParseExact(StringInput.ToString,"MM/dd/yyyy hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy")
It will get the Month in the Upper case
DateTime.ParseExact("09/26/2022 00:00:00","MM/dd/yyyy hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy").ToUpper
its working. I have another Doubt in 09/26/2022 00:00:00 if i want to remove this 00:00:00 time stamp what expression I need to give
You can try with Regex Expression
System.Text.RegularExpressions.Regex.Replace(YourString,"\b\d{2}:\d{2}:\d{2}\b","").Tostring
Regards
Gokul
Thanks Gokul, I have got the Required Output
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.