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);
Manish
  • 39
  • 1
  • 8

1 Answers1

0

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.

Leo
  • 6,553
  • 2
  • 29
  • 48
  • 1
    have sorted this issue by adding +1 hr in event date like this >> define("GCAL_DST","+01:00"); $startDate = date('Y').'-'.date('m').'-'.date('d').'T'.date('H').':'.date('i').':00'.GCAL_DST; Works fine for now. – Manish May 11 '12 at 08:37