ajax swift 拦截,javascript - Microsoft AJAX serialized dates with time swift - Stack Overflow

在MVC3 Web API应用中,控制器返回的JSON日期被自动序列化为UTC时间,但JavaScript解析后显示为CEST(夏令时),比实际时间快1小时。问题可能出在.NET默认的日期序列化或者JavaScript的日期转换上。如何修复这个问题?
摘要由CSDN通过智能技术生成

I have an MVC 3 web application for a web API, a controller emit json.

In the json result I see dates are being serialised automatically

as

{

Flag: "U"

EventId: "168ef1d4-60ca-4fa1-b03b-8c3207650347"

EventTitle: "test event 11"

DateTimeStart: "/Date(1369217469310)/"

IsCustomEvent: true

Location: null

}

in javascript I need to convert DateTimeStart in human readable format and using this code

var date = new Date(1369217469310);

alert(date);

I see the resulting data as

Wed May 22 2013 12:11:09 GMT+0200 (CEST)

This is 1 hour a head of the date stored in the application wich is 22/05/2013 11:11:09.

I would like to know where the issue could be and how to fix it:

Is it .Net serialising dates by default using CEST wich is +1 UCT, in this case how to set up UCT at 0?

Is it an issue when converting in the date using JavaScript?

Please let em know how you would fix it, thanks!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值