如何通过Graph API创建一个Facebook事件以使特定时间和时区不因个人用户而改变?
问题描述:
我正在使用Facebook Graph API将事件发布到粉丝页面。我们的活动是亲临活动;因此,我们希望在该地点的时区发布活动,以便任何Facebook用户看到该活动;它在事件位置的当地时间中列出,并且如果用户不是该时区的一部分,则显示时区。 (基本上不具备精确的时区功能;其中事件时间调整为在用户的时区中显示)。我可以在Facebook中手动创建一个事件,其中设置了时区并且时间始终显示在当地时区。 Example of how the manually created event is displayed to a user which is not in the event location's time zone如何通过Graph API创建一个Facebook事件以使特定时间和时区不因个人用户而改变?
但是,我没有看到任何有关如何用Graph API完成该行为的文档。我希望有人能指出我正确的方向来完成这种行为?
答
当发布到图形API时,您可以为动作设置start_time。
然后,您可以使用下面的日期格式模板:
yyyy-MM-dd'T'HH:mm:ss-03
其中的日期应该是UTC和“-03”,是产生事件(布宜诺斯艾利斯在我的情况)的时区。这样,Facebook会将日期显示给用户的当前时区。
这里有一个关于这个文件的一部分:
Represents a temporal value composed for a date (year, month and day) and an optional time component (hours, minutes).
Uses the ISO 8601 timestamp format, with the timezone defaulting to UTC. Expected format is YYYY-MM-DDThh:mm:ssZ, where Z is an offset from UTC to express a different time zone.
Also supports literals that conform to the following patterns:
%Y%m%dT%H%MZ
%Y%m%dT%H%M
%Y-%m-%dT%H:%MZ
%Y-%m-%dT%H:%M
%Y-%m-%d
%d-%m-%Y
%Y/%m/%d
%m/%d/%Y
%Y/%m/%dT%H:%MZ
%Y/%m/%dT%H:%M
查看完整的文档在这里:https://developers.facebook.com/docs/opengraph/creating-custom-stories#propertytypes