DateTime.Now.ToString ("M / d / yyyy h: mm tt") shows the opposite in windows 7

Ok, I have a Label on my program that updates over time with a timer like this:

Label1.Text = DateTime.Now.ToString("M/d/yyyy h:mm tt", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));

It should print (and does this when hovering over a variable in Visual Studio):

12/15/2010 8:41 PM

But instead it prints out:

PM 8:41 12/15/2010

This is the only place in my code that changes the label. It works in Windows XP, but now I use my code in Windows 7, it took off. Please help me. I am not sure why this is happening.

Thanks for any help!

+3
source share
2 answers

The RightToLeftcontrol parameter seems to be true- change it to false.

+3
source

Argh, RightToLeft . , , . @RedDeckWins!

+1

Source: https://habr.com/ru/post/1780573/


All Articles