IIS日期时间问题 [英] IIS datetime problem

查看:120
本文介绍了IIS日期时间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的系统中格式化并安装了Windows 7旗舰版。之后操作系统采用默认日期时间格式dd-mm-yyyy。这对我托管的asp.net Web应用程序无效,所以我将系统日期时间格式更改为MM / dd / yyyy,这时我在本地测试了我的Web应用程序,显示了我更改的日期时间格式。



但是当我托管这个Web应用程序时,我的IIS正在返回Old格式,即dd-mm-yyyy,

那么我怎么能解决这个问题。





提前感谢...........

解决方案

通过向DateTime.ToString()添加格式提供程序。例如,

 DateTime someWhen = DateTime.Now; 
string str = someWhen.ToString( MM / DD / YYYY);


Hi all,

In my system formatted and installed the Windows 7 Ultimate. after that the OS taken default date time format dd-mm-yyyy. this is not valid for my hosted asp.net web application, So I changed my system datetime format as MM/dd/yyyy, here when I tested the my web application in local they showing my changed datetime format.

But when I hosted this web application my IIS it is returning Old format i.e., dd-mm-yyyy,
So how can I resolve this.


thanks in advance...........

解决方案

By adding a format provider to DateTime.ToString(). E.g.

DateTime someWhen= DateTime.Now;
string str = someWhen.ToString("MM/dd/yyyy");


这篇关于IIS日期时间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆