为特定的 Visual Studio 项目设置日期时间格式

发布于 2024-11-16 09:39:51 字数 366 浏览 7 评论 0 原文

在我的机器上我有几个视觉工作室项目,

如果我使用 Response.Write(Date.Now)

它会给我: 21/6/2011 2:44:49 PM

除了它给我的一种解决方案之外的所有内容: 6/21/2011 2:44:49 PM

我检查了所有内容,全部设置相同:

  1. 控制面板中的区域设置

这个解决方案有什么问题???

谢谢

On my machine I have several visual studio projects,

if I use
Response.Write(Date.Now)

it will give me : 21/6/2011 2:44:49 PM for all

except one solution it gives me: 6/21/2011 2:44:49 PM

I checked everything, all set the same:

  1. Regional settings in control panel

  2. <globalization culture="en-AU" uiCulture="en-AU" />

what is wrong with that one soltion???

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧瑾黎汐 2024-11-23 09:39:51

好吧,对我来说,一个好的起点是检查运行代码中的 CultureInfo.CurrentCultureCultureInfo.CurrentUICulture 静态属性。

您还可以提供更广泛的上下文,例如它来自的 Date 是什么,或者 Response.Write 代码实际执行的操作。

Well, to me a good place to start would be checking CultureInfo.CurrentCulture and CultureInfo.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.

我ぃ本無心為│何有愛 2024-11-23 09:39:51

我修复了它,

我在注册表中搜索了 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文