At the moment I'm returning the date like this:
string returnValue = DateTime.Now.ToString("d MMMMMMMMMMMMMM yyyy");
The problem is, if the person who is running the program is from the USA, I need to return it like this: October 15, 2014
When the user runs the program, I can change the cultureinfo with this code (this is working):
Thread.CurrentThread.CurrentCulture = new CultureInfo(SelectedLanguage.LanguageCode);
I can use
string returnValue = DateTime.Now.ToString("d MMMMMMMMMMMMMM yyyy");
if(Thread.CurrentThread.CurrentCulture == "en-US") {
returnValue = DateTime.Now.ToString("MMMMMMMMMMMMMM d, yyyy");
}
But if there is another region, I need to add another if-statement... Can't I write this with dynamic code, so I have the correct format with one line of code?