2012-12-09 118 views
1

我正在使用相当简单的FQL查询来查询页面中的所有事件。在FQL中过滤facebook事件日期

SELECT 
    eid, name, pic_big, start_time, end_time, location, description 
    , creator, host, venue 
FROM 
    event 
WHERE 
    eid IN (SELECT eid FROM event_member WHERE uid = {$uid}) 
ORDER BY start_time asc 

在历史Facebook存储它的start_timeend_time在时间戳是简单到只得到未来事件:... AND end_time >= {$now} ...

但Facebook改变了它在时区的字段的格式。 有没有一种简单的方法,最好在fql中,只显示未来事件?

回答

1

除非我误解了你的问题,我只是在Facebook Graph API & FQL Explorer上试过这个,它似乎工作。

我对您的查询所做的唯一更改是分别将{$uid}{$now}分别替换为me()now()。下面的查询返回只为我的帐户未来事件:

SELECT eid, name, pic_big, start_time, end_time, location, description, creator, host, venue 
FROM event 
WHERE eid 
IN (SELECT eid FROM event_member WHERE uid = me()) 
AND start_time >= now() 

你可以在行动查看此:Facebook Graph API Explorer Example 当然要确保你提供的资源管理器,您帐户的有效访问令牌。