FaceBook Time zone and Event Times

左心房为你撑大大i 提交于 2019-12-24 07:25:37

问题


I am trying to add Events To FaceBook with the Time Zone option enabled. I am trying to add Events in UK with time zone as "Europe/London" . This is what I am noticing.

When I send the following Start & End times

[start_time] => 2014-08-24T20:00:00+0100
[end_time] => 2014-08-24T22:00:00+0100

I get the time as

[When]
    Sunday, August 24, 2014
    [Time]
    8:00pm until 10:00pm 

when viewed from FaceBook Site. My time zone is set to London which is UTC. But when I send an event in November,

[start_time] => 2014-11-24T20:00:00+0000
[end_time] => 2014-11-24T22:00:00+0000

it is getting displayed as

[When]
        Monday, November 24, 2014
        [Time]
        9:00pm until 11:00pm 

Is this an expected behavior. Will the time be adjusted and 8 PM will show correctly on Nov 24th?

Thanks Lynn


回答1:


One small correction. You said:

My time zone is set to London which is UTC

The Europe/London zone is UTC+00:00 in the winter, which is commonly called GMT. In the summer it switches to UTC+01:00. which is commonly called BST. It wouldn't be accurate to say that London is UTC. I think you knew this already, I'm just stating it here for others.

Unfortunately, the behavior you describe is expected for Facebook. It comes down to the fact that Facebook doesn't know you are in Europe/London. It simply gets your current time zone offset from JavaScript's new Date().getTimezoneOffset() when you log in. Since it's currently UTC+01:00, that's the offset that is applied to the events when you view the page as a user. It makes a flawed assumption that the offset will not change, or that you won't be looking at future event times until after the next transition.

The Facebook Graph API represents this in the user object. It has a timezone property that is just a number. I guess the Facebook developers haven't read the timezone tag wiki where I make clear that "Time Zone != Offset".

Will the time be adjusted and 8 PM will show correctly on Nov 24th?

Yes. It will show the correct time as soon as the user logs in after the next switch from BST to GMT, which is on October 27th this year.



来源:https://stackoverflow.com/questions/18204372/facebook-time-zone-and-event-times

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