如何获得Facebook服务器时间? [英] How do I get the Facebook Server Time?
问题描述
我已经在客户端上创建了一个使用Flash的Facebook iframe应用程序,并在服务器上创建了.net。我正在使用氟FX进行通信。
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.
我需要从我的服务器获取确切的Facebook服务器时间。这是为了在我的服务器上验证用户,所以我不想想从客户端获取时间,然后将其传递到服务器。这是Facebook从我的服务器所需要的唯一交互,所有其他交互都由客户端使用旧的休息API来处理。
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.
最好的方式是做什么?我读过你可以使用FQL,但看到只是我正在寻找的时间有一种方法,不涉及在服务器上获取authToken?
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?
谢谢!
Tim
Thanks! Tim
推荐答案
您可以在Facebook FQL查询中调用now()来获取当前Facebook服务器的时间unix时间戳,然后从那里转换它,但你需要。
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.
例如,这里是一个示例FQL查询,没有auth令牌(fql语句需要一个where子句,所以我刚刚抓到随机的一个随机的fql表,语句):
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'
FQL测试工具来帮助。
这篇关于如何获得Facebook服务器时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!