douzhi2760 2012-03-28 20:55
浏览 55

DST导致GCal事件的+1小时时差

I've a php based application where I've integrated GCal with OAuth 2.0 API. Everything works fine except the DST +1 hour issue. This application is only for UK and I'm also storing the user account timezones. If I'm adding a task at 3:00 AM, on GCal it shows me 4:00 AM. This is when I've hard coded the timezone as Europe/London in setTimeZone() while adding task. Moreover the GCal account setting is also as Europe/London. This is bit frustrating so please help me on what should I change in my code to handle this DST +1 hour time difference. Here is the code :

$evt = new Event();
$evt->setDescription($txtDesc); 
$evt->setSummary($taskTypeTxt);

#--Setting Event Date
$evtDT  = new EventDateTime();
$evtDT2     = new EventDateTime();

$evtDT->setDateTime($startDate); 
$evtDT->setTimeZone('Europe/London');

$evtDT2->setDateTime($endDate);
$evtDT2->setTimeZone('Europe/London');
$evt->setOriginalStartTime($evtDT);
$evt->setStart($evtDT);
$evt->setEnd($evtDT2);

$field = array('items/id');
$evtId = $cal->events->insert($user_email,$evt,$field);
  • 写回答

1条回答 默认 最新

  • dongye3917 2012-05-03 08:11
    关注

    I'm suffering the same problem.

    There seems to be some ambiguity over whether to set the timezone to GMT+0 or GMT+1 (BST). The latter would imply that I will subsequently have to handle DST changes manually, but when I set GMT+0 it didn't automatically update when the clocks changed.

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题