在iis上发布后在本地可以正常工作的日期格式错误

编程入门 行业动态 更新时间:2024-10-14 08:27:33
本文介绍了在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上发布后在本地可以正常工作的日期格式错误

本文发布于:2023-11-02 03:55:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551300.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   日期   格式   工作   iis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!