How do I get the Facebook Server Time?

空扰寡人 提交于 2019-12-08 02:43:04

问题


I have created a facebook iframe app using Flash on the client and .net on the server. I am using fluorineFX to communicate between the two.

I need to get the exact facebook server time from my server. This is for authenticating the user on my server so I don't want to get the time from the client and then pass it to the server. This is the only interaction I need with Facebook from my server, all other interaction is handled by the client using the old rest API.

What is the best way to do this? I have read you can use FQL but seeing as its just the time I am looking for is there a way which does not involve getting an authToken on the server?

Thanks! Tim


回答1:


You can call now() in a Facebook FQL query to get the current Facebook server time in a unix timestamp and then convert it from there however you need.

For example, here is a sample FQL query that would work without an auth token (fql statements require a where clause so I just grabbed a random fql table with a random where statement):

SELECT now() FROM link_stat WHERE url = '1.2'

The url for that query would be: https://api.facebook.com/method/fql.query?query=SELECT+now%28%29+FROM+link_stat+WHERE+url+%3D+%271.2%27&format=json

Facebook provides a FQL testing tool to help.



来源:https://stackoverflow.com/questions/3952954/how-do-i-get-the-facebook-server-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!