为特定的 Visual Studio 项目设置日期时间格式
在我的机器上我有几个视觉工作室项目,
如果我使用 Response.Write(Date.Now)
它会给我: 21/6/2011 2:44:49 PM
除了它给我的一种解决方案之外的所有内容: 6/21/2011 2:44:49 PM
我检查了所有内容,全部设置相同:
-
控制面板中的区域设置
这个解决方案有什么问题???
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,对我来说,一个好的起点是检查运行代码中的
CultureInfo.CurrentCulture
和CultureInfo.CurrentUICulture
静态属性。您还可以提供更广泛的上下文,例如它来自的
Date
是什么,或者 Response.Write 代码实际执行的操作。Well, to me a good place to start would be checking
CultureInfo.CurrentCulture
andCultureInfo.CurrentUICulture
static properties in the running code.Also you can provide wider context, for example what is
Date
there it comes from, or what Response.Write code actually do.我修复了它,
我在注册表中搜索了 yyyy,
我将所有 M/d/yyyy 更改为 d/M/yyyy
现在工作正常
I fixed it,
I searched registry for yyyy,
I changed all M/d/yyyy to d/M/yyyy
it is working fine now