V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gaolinjie
V2EX  ›  API

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

  •  
  •   gaolinjie · 2012-12-11 00:00:29 +08:00 · 3535 次点击
    这是一个创建于 4144 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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
    的含义,为什么是这么一串数字?
    6 条回复    1970-01-01 08:00:00 +08:00
    gaolinjie
        1
    gaolinjie  
    OP
       2012-12-11 00:00:52 +08:00
    best1a
        2
    best1a  
       2012-12-11 00:07:19 +08:00
    目测是从1970年1月1日0时起的秒数...
    ElmerZhang
        3
    ElmerZhang  
       2012-12-11 01:10:25 +08:00
    Unix 时间戳
    reus
        4
    reus  
       2012-12-11 01:19:41 +08:00
    从1970年1月1日0点起的秒数
    chrisyipw
        5
    chrisyipw  
       2012-12-11 05:45:23 +08:00
    Milliseconds,只是最后三位,即毫秒,没显示而已(比如 Ruby 把毫秒放在小数点后,转整数就会砍掉),只保留了年月日时分秒信息。对于毫秒也属于整数一部分的语言(如 JavaScript),要转换成 Date 对象,只需乘以 1000。
    用 milliseconds 做时间的单位,好处是只需要处理数字(比如日期大小、比如距今多少天),并且省去时区的隐患:得出结果后再转时区。
    Livid
        6
    Livid  
    MOD
       2012-12-11 07:33:47 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3246 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:49 · PVG 21:49 · LAX 06:49 · JFK 09:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.