Jeremyvnc
Jeremyvnc

Reputation: 65

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

Okay, I have a Label on my program that gets updated with the time on a timer like so:

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

It should print out (and does when hovering over the variable in Visual Studio):

12/15/2010 8:41 PM

But instead prints out:

PM 8:41 12/15/2010

This is the only place in my code that the label is getting changed. It works in windows XP but now I'm using my code in windows 7, it gets jacked up. Please help me. I'm unsure as to why this is going on.

Thanks for any help!

Upvotes: 3

Views: 1556

Answers (2)

RedDeckWins
RedDeckWins

Reputation: 2121

It seems that the RightToLeft setting of the control is true - change that to false.

Upvotes: 3

Jeremyvnc
Jeremyvnc

Reputation: 65

Argh, RightToLeft setting was true. Don't know why but it was. Thanks @RedDeckWins!

Upvotes: 1

Related Questions