DateTime.Now.ToString(“M/d/yyyy h:mm tt”) 在 Windows 7 中显示相反
好吧,我的程序上有一个标签,它会随着计时器上的时间而更新,如下所示:
Label1.Text = DateTime.Now.ToString("M/d/yyyy h:mm tt", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
它应该打印出来(并且将鼠标悬停在 Visual Studio 中的变量上时):
12/15/2010 8:41 PM
但打印出:
PM 8:41 12/15/2010
这是我的程序中唯一的位置标签正在更改的代码。它在 Windows XP 中工作,但现在我在 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
控件的
RightToLeft
设置似乎是true
- 将其更改为false
。It seems that the
RightToLeft
setting of the control istrue
- change that tofalse
.啊,
RightToLeft
设置为 true。不知道为什么,但确实如此。谢谢@RedDeckWins!Argh,
RightToLeft
setting was true. Don't know why but it was. Thanks @RedDeckWins!