博客首页 » Web Json Date Time, Timestamp
发布于 29 Sep 2014 03:13
标签 blog
Json 并不支持原生的Date, Time和 Timestamp
Mark Embling在他的这篇博文里说的很好。
http://markembling.info/2011/07/json-date-time
有三个解决方法:
// Serialise to a string representing the date & time
{"point_in_time": "2011-07-14 19:43:37 +0100"} // Ruby does this
{"point_in_time": "2011-07-14T19:43:37+0100"} // ISO 8601
// Javascript Date object
{"point_in_time": new Date(1310669017000)}
// Common in the .NET world (again, a string)
{"point_in_time": "\/Date(1310669017000)\/"}
他也提到了,Bertrand Le Roy的这篇文章
http://weblogs.asp.net/bleroy/dates-and-json
本页面的文字允许在知识共享 署名-相同方式共享 3.0协议和GNU自由文档许可证下修改和再使用,仅有一个特殊要求,请用链接方式注明文章引用出处及作者。请协助维护作者合法权益。
系列文章
文章列表
- Web Json Date Time, Timestamp
这篇文章对你有帮助吗,投个票吧?
留下你的评论