Convert from romanian datetime format to another format


I have this romanian datetime string Septembrie 2022 and have to convert it to Sep 2022 (this is also romanian datetime format) without replace or regex.

Thank you!


How about the following expression?

DateTime.ParseExact("Septembrie 2022","MMMM yyyy",System.Globalization.CultureInfo.CreateSpecificCulture("Ro-ro")).ToString("MMMM yyyy")


HI @Andrei_Croitoru

How about this expression?

DateTime.ParseExact("Septembrie 2022","MMMM yyyy",System.Globalization.CultureInfo.InvariantCulture.CreateSpecificCulture("Ro")).ToString("MMM yyyy")

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.