c# - DateTime Format Issue in c# for multiple Application on same IIS server
问题描述
I deployed my ASP.Net web application and WCF web service to the same default web site on the same IIS server with the same application pool. When I use the web application I see the DateTime.UtcNow
value in dd/mm/yyyy
format. When I use the WCF web service I see the DateTime.UtcNow
value in mm/dd/yyyy
format.
How can I make the two agree on the same format? Ideally it should get the local machine time format, which is mm/dd/yyyy
. Is there any kind of settings is provided in the web.config file or machine config file or IIS settings so that all the application are able to fetch the correct date time format?
My WCF soap services uses the soapUi tool.
Below are the observed DateTime formats for each application:
main App: dd/mm/yyyy wcf webservices: mm/dd/yyyy local machine : mm/dd/yyyy applicationPool: asp.net4.5
解决方案
推荐阅读
- php - 不明白为什么需要 $_SESSION
- arduino - 使用通过 CAN 总线发送的信息在 Arduino 上闪烁 LED 时出现问题
- symfony - 如何使用 Symfony 解决 URL 中的 ID 传递问题
- for-loop - 测试数组/列表的所有元素是否满足条件的最佳方法
- postgresql - 访问列数组并将其存储在新表中
- c# - 使用百分比,我如何获得两个日期时间之间的时间?
- javascript - 响应式可折叠表一次一张:
- python - 如何在tweepy中过滤关键字搜索
- sql - 如何在 SQL 中聚合数量?
- python - 为什么 pip install 缺少我的软件包的源?