4

根据以下文档,可以通过 date_format 参数调整从 Facebook API 返回的日期格式。在下面的 REST URL 中,我在 facebook 事件调用中实现了参数“U”,指定我希望我的日期作为 UNIX 时间戳返回。

https://graph.facebook.com/269229076559525?date_format=U?access_token

如果您查看返回的 JSON,updated_time 字段现在作为 unix 时间戳返回,但 start_time 字段不受影响。

{
  "id": "269229076559525", 
  "owner": {
    "name": "{removed}", 
    "id": "{removed}"
  }, 
  "name": "Windham Flat's Winter Dance Party", 
  "description": "Windham Flat's Winter Dance Party, Featuring:\n\nWindham Flat\nThat's Not Her\nEl Super Ritmo!\n\nSaturday, December 21st, Make-Out Room\n", 
  "start_time": "2013-12-21T19:30:00-0800", 
  "timezone": "America/Los_Angeles", 
  "is_date_only": false, 
  "location": "Make-Out Room", 
  "venue": {
    "latitude": 37.755280780054, 
    "longitude": -122.41943796736, 
    "city": "San Francisco", 
    "state": "CA", 
    "country": "United States", 
    "id": "32498706383", 
    "street": "3225 22nd Street", 
    "zip": "94110"
  }, 
  "privacy": "OPEN", 
  "updated_time": 1386740974
}

任何人都可以建议我如何让 API 将我的 start_time 作为指定的 date_format 返回。

4

0 回答 0