Hi, @Swapnil Lomate .There are 2 workarounds here you can reference. They all give the "21 apr 2023" result.
1 Simply replace the "." with empty
var dateString = date.ToString("dd MMM yyyy", cultureInfo).Replace(".", "")
2 Fix the AbbreviatedMonthNames
and AbbreviatedMonthGenitiveNames
in a new culture
var date = DateTime.UtcNow;
var cultureInfo = CultureInfo.GetCultures(CultureTypes.AllCultures).FirstOrDefault(c => c.LCID == 29);
cultureInfo.DateTimeFormat.AbbreviatedMonthNames = cultureInfo.DateTimeFormat.AbbreviatedMonthNames.Select(x => x.TrimEnd('.')).ToArray();
cultureInfo.DateTimeFormat.AbbreviatedMonthGenitiveNames = cultureInfo.DateTimeFormat.AbbreviatedMonthGenitiveNames.Select(x => x.TrimEnd('.')).ToArray();
var dateString = date.ToString("dd MMM yyyy", cultureInfo);
Console.WriteLine(dateString);
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.