我正在使用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实现该行为的任何文档。我希望有人能指出我正确的方向来完成这种行为吗?
答案 0 :(得分:0)
您可以在发布到Graph 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