在iis上发布后在本地可以正常工作的日期格式错误 [英] Date format error after publishing on iis working fine locally

查看:86
本文介绍了在iis上发布后在本地可以正常工作的日期格式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的应用程序中,在iis上发布后计算会出错,但是在Visual Studio中运行时它可以正常工作

我正在使用日期dd/mm/yyyy格式,例如01/04/2009,这在发布后可以很好地与代码一起工作,它将日期作为mm/dd/yyyy格式(如04/01/2009),因此月份将随着时间的推移而变化,在iis上发布后,计算会出错,但可以与在本地运行的Visual Studio一起正常使用

我以不同的方式将culturinfo设置为iformatprovider的en-GB,但无法正常工作.

请给我一个解决方案,让iis或其他任何设置

谢谢
pavan kumar

hi all,

In my application calculations are going wrong after publishing on iis but it is working properly while running in visual studio

i am taking date dd/mm/yyyy format for eg 01/04/2009 this is working fine with code after publshing it takes the date as mm/dd/yyyy format like 04/01/2009 so that month is coming as diffrent and calculation goes wrong after publishing on iis but its working properly with visual studio running locally

i tried in different ways with culturinfo setting to en-GB for iformatprovider but it is not working.

plz suggest me a solution any settings in iis or anything

thanks
pavan kumar

推荐答案

IIS服务器将设置为使用美国日期格式.您将需要在Web应用程序的web.config文件中指定正确的本地化.

例如,要为所有页面设置UI文化和文化,请在Web.config文件中添加一个全球化部分,然后设置uiculture和文化属性,如下所示:

< globalization uiCulture ="zh-CN" culture ="zh-gb"/>
The IIS server will be set to use American Date format. You will need to specify the correct localisation within your web app''s web.config file.

for example, to set the UI culture and culture for all pages, add a globalization section to the Web.config file, and then set the uiculture and culture attributes, as shown below:

<globalization uiCulture="en" culture="en-gb" />


这篇关于在iis上发布后在本地可以正常工作的日期格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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