请问V2EX API提供的json数据中created元和last_modified元代表的一串数字是什么含义?

2012-12-11 00:00:29 +08:00
 gaolinjie
http://www.v2ex.com/api/replies/show.json?topic_id=2
返回的json数据如下:
[{

"id" : 2,
"title" : "访问速度?",
"url" : "http://www.v2ex.com/t/2",
"content" : "大家目前访问这个网站的速度如何?\u000D\u000A\u000D\u000A我还没有把任何 cache 打开。",
"content_rendered" : "大家目前访问这个网站的速度如何?\u000D\u000A\u003Cbr /\u003E\u000D\u000A\u003Cbr /\u003E我还没有把任何 cache 打开。",
"replies" : 43,
"member" : {
"id" : 1,
"username" : "Livid",
"tagline" : "Beautifully Advance",
"avatar_mini" : "http://cdn.v2ex.com/avatar/c4ca/4238/1_mini.png?m=1353664649",
"avatar_normal" : "http://cdn.v2ex.com/avatar/c4ca/4238/1_normal.png?m=1353664649",
"avatar_large" : "http://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1353664649"
},
"node" : {
"id" : 1,
"name" : "babel",
"title" : "Project Babel",
"url" : "http://www.v2ex.com/go/babel",
"topics" : 1040,
"avatar_mini" : "http://www.v2ex.com/static/img/node_mini.png",
"avatar_normal" : "http://www.v2ex.com/static/img/node_normal.png",
"avatar_large" : "http://www.v2ex.com/static/img/node_large.png"
},
"created" : 1272207731,
"last_modified" : 1335106658,
"last_touched" : 1294932324

}]

但是一直搞不清"created" : 1272207731,
"last_modified" : 1335106658,
"last_touched" : 1294932324
的含义,为什么是这么一串数字?
3543 次点击
所在节点    API
6 条回复
gaolinjie
2012-12-11 00:00:52 +08:00
best1a
2012-12-11 00:07:19 +08:00
目测是从1970年1月1日0时起的秒数...
ElmerZhang
2012-12-11 01:10:25 +08:00
Unix 时间戳
reus
2012-12-11 01:19:41 +08:00
从1970年1月1日0点起的秒数
chrisyipw
2012-12-11 05:45:23 +08:00
Milliseconds,只是最后三位,即毫秒,没显示而已(比如 Ruby 把毫秒放在小数点后,转整数就会砍掉),只保留了年月日时分秒信息。对于毫秒也属于整数一部分的语言(如 JavaScript),要转换成 Date 对象,只需乘以 1000。
用 milliseconds 做时间的单位,好处是只需要处理数字(比如日期大小、比如距今多少天),并且省去时区的隐患:得出结果后再转时区。
Livid
2012-12-11 07:33:47 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/54585

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX