如何设置iis的格式日期时间以及发布项目时格式日期的更改 [英] How to set format datetime for iis and when publish project the format date changed
本文介绍了如何设置iis的格式日期时间以及发布项目时格式日期的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何设置iis的格式日期时间以及发布项目格式日期何时更改为什么??
How to set format datetime for iis and when publish project the format date changed why??
推荐答案
如果没有为DateTime变量提供特定格式,将使用应用程序的CurrentCulture / CurrentUICulture的默认设置调用ToString()方法。
因此,您有两个解决方案:
- 自己提供格式(myDateTimeVariable.ToString(dd-MM-yyyy)
)
- 为每个新线程设置Culture(Thread .CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(de-AT)
)
If you do not supply a specific format for DateTime variables, the ToString() method will be called with the default setting for the CurrentCulture / CurrentUICulture of your application.
Hence you have two solutions:
- provide the format evertime yourself (myDateTimeVariable.ToString("dd-MM-yyyy")
)
- set the Culture for every new thread (Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("de-AT")
)
这篇关于如何设置iis的格式日期时间以及发布项目时格式日期的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文