【发布时间】:2017-06-05 02:19:31
【问题描述】:
我尝试new Date()获取UTC当地时间,
但现在 js 无法添加时区偏移量(例如,为中国添加 8 小时)。
在它正常工作之前。
在博客On the nightmare that is JSON Dates. Plus, JSON.NET and ASP.NET Web API
【问题讨论】:
-
关于您的编辑,JSON.NET 和 Web API 使用的 ISO 8601 日期格式包括为 UTC 添加的
Z。 in JSON.NET's documentation –"2012-03-19T07:22Z"有一个例子。 -
@JonathanLonowski 谢谢,我刚刚发现 [
timeago](timeago.yarp.com) jquery 插件在 chrome 58 中无法正常工作。
标签: javascript google-chrome date asp.net-web-api2