FaceBook时区和事件时间 [英] FaceBook Time zone and Event Times

查看:1035
本文介绍了FaceBook时区和事件时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在启用时区"选项的情况下将事件添加到FaceBook.我正在尝试将时区为"Europe/London"的UK中的事件添加.这就是我注意到的.

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

我有时间

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

从FaceBook网站查看时.我的时区设置为伦敦,即UTC.但是当我在11月发送活动时,

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

它显示为

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

这是预期的行为吗?时间会调整,并且11月24日晚上8点会正确显示吗?

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

谢谢 琳

推荐答案

一个小的更正.你说:

我的时区设置为伦敦,即UTC

My time zone is set to London which is UTC

冬天的Europe/London区域是UTC+00:00,通常称为GMT.在夏季,它将切换为UTC+01:00.通常称为BST.说伦敦 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.

不幸的是,您描述的行为是Facebook所期望的.归结为以下事实:Facebook不知道您在Europe/London中.登录时,它只是从JavaScript的new Date().getTimezoneOffset()中获取您当前的时区偏移量.由于它当前是UTC+01:00,因此这是您以用户身份查看页面时应用于事件的偏移量.这种错误的假设是,偏移量不会改变,或者直到下一次转换之后您才可以查看将来的事件时间.

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.

Facebook Graph API在 user 对象中表示了​​这一点.它具有timezone属性,该属性只是一个数字.我想Facebook开发人员还没有阅读时区标签Wiki ,在这里我明确指出时区=偏移".

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".

时间会调整,并且11月24日下午8点会正确显示吗?

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

是的.下一次从BST切换到GMT后,用户登录后,它将立即显示正确的时间,

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.

这篇关于FaceBook时区和事件时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆