Facebook 最近在其开发者路线图中添加了无时区事件(https://developers.facebook.com/roadmap/#timezone-less-events),上面写着
“自从最初创建此迁移以来,我们已向事件添加了一个时区字段,该字段指示预计事件发生的时区名称(如此处定义)。仅供参考,开发人员在 ISO 8601 中读取时间应该支持完整标准读取事件时间时。大多数事件返回本地时间(无 GMT 偏移),但未来事件可能会返回其他格式(即仅日期和精确)。
它适用于 ISO 8601 格式的日期,但如果我得到纪元格式的日期,我总是会得到 +7 小时的差异。
例如
https://graph.facebook.com/369000383135224返回
{
"id": "369000383135224",
"owner": {
"name": "Horst Uwe Peter",
"id": "1117563687"
},
"name": "Event in Dublin time 10:25",
"start_time": "2012-05-04T10:25:00",
"end_time": "2012-05-04T11:25:00",
"timezone": "Europe/Dublin",
"location": "Dublin, Ireland",
"venue": {
"id": "110769888951990"
},
"privacy": "FRIENDS",
"updated_time": "2012-05-04T09:27:29+0000",
"type": "event"
}
和
http://graph.facebook.com/369000383135224?date_format=U返回
{
"id": "369000383135224",
"owner": {
"name": "Horst Uwe Peter",
"id": "1117563687"
},
"name": "Event in Dublin time 10:25",
"start_time": 1336152300, <== Fri, 04 May 2012 17:25:00 GMT
"end_time": 1336155900, <== Fri, 04 May 2012 18:25:00 GMT
"timezone": "Europe/Dublin",
"location": "Dublin, Ireland",
"venue": {
"id": "110769888951990"
},
"privacy": "FRIENDS",
"updated_time": 1336123649,
"type": "event"
}
以及使用 GRAPH 端点的 FQL
graph.facebook.com/fql?q=选择 eid、名称、描述、位置、地点、开始时间、结束时间、更新时间、创建者、隐私 FROM 事件 WHERE eid = 369000383135224
{
"data": [
{
"eid": 369000383135224,
"name": "Event in Dublin time 10:25",
"description": "",
"location": "Dublin, Ireland",
"venue": {
"id": 110769888951990
},
"start_time": 1336152300, <== Fri, 04 May 2012 18:25:00 GMT
"end_time": 1336155900, <== Fri, 04 May 2012 18:25:00 GMT
"update_time": 1336123649,
"creator": 1117563687,
"privacy": "FRIENDS"
}
]
}
这是否意味着迁移仅适用于 ISO 8601 格式的日期?并且对 FQL 或纪元日期格式没有影响?