PHP Classes

Outlook start time issue

Recommend this page to a friend!

      iCalCreator  >  All threads  >  Outlook start time issue  >  (Un) Subscribe thread alerts  
Subject:Outlook start time issue
Summary:Outlook moving events forward 1 hour for daylight savings
Messages:3
Author:Paul Gutches
Date:2013-03-19 08:44:21
Update:2013-07-15 16:55:57
 

  1. Outlook start time issue   Reply   Report abuse  
Picture of Paul Gutches Paul Gutches - 2013-03-19 08:44:21
Hello

I've been trying to crack this timezone nut for a while, to no avail. Hopefully this will be an easy one for you folks.

I am consistently creating ics files in an appointment system that are very reliable in Mac iCal and iCloud.

Trouble is, the same ics file is potentially administrated from Outlook 2010 on Windows 2007.

When it is opened in Outlook, it is consistently 1 hour ahead of the correct time.

This is obviously a daylight savings time issue, but what is not clear is which end is causing the problem... the file, or the local OS or App settings?

The ics files are set to eastern time (US/Eastern), and show that in the time zone field in Mac iCal when imported. The iCalCreator class default timezone is also set to US/Eastern

Mac is set to Eastern New York with daylight adjustment
Windows is set to US-Canada/Eastern
iCloud is set to Eastern/New York
Outlook is set to UTC -05:00 (based on Windows settings). The assumption here is that
the -05:00 represents standard time but Windows has already shifted the clock forward 1 hour, because it is correct.
Windows is set to observe daylight savings.

The ics TZID is set to US/Eastern
There is a timezone component that has the proper offsets for Standard and Daylight
(example included)

One caveat... I have no solid example of how to construct a proper timezone object, so my constructor came from trial and error.

The only vtimezone component example I found included an unexpected Repeat component with a DTSTART in the EST and EDT components for the year 2007, even though the event was a 1-time event in 2013. So I avoided that solution. What is unclear is... in the timezone component, should the DTSTART be different in the EST than the EDT? I know the offset is different, but I figured that the time should be the same for both. Is that right?

Here is an example of an ics that works perfectly in iCal and iCloud, but not in Windows Outlook 2010. Perhaps someone here could import it in Outlook and see if they can duplicate the EDT shift?

In any event, please let me know if you see anything obviously wrong in either the ics or constructor which follows it. Or if you have any other ideas where the root of the problem is. Thank you.

Paul


ics output: -------------------------------------------

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//website.com//NONSGML kigkonsult.se iCalcreator 2.12//
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:calname
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:US/Eastern
BEGIN:STANDARD
DTSTART:20130418T161500
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20130418T161500
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:20130318T182304EDT-9677uvKjGK@website.com
DTSTAMP:20130318T222304Z
CATEGORIES:Calendar
CLASS:PRIVATE
DESCRIPTION:
DTSTART;TZID=US/Eastern:20130418T161500
DTEND;TZID=US/Eastern:20130418T173000
SUMMARY:Gutches\, Paul
END:VEVENT
END:VCALENDAR


// constructor code: -------------------------------------------
// note: $tz = 'US/Eastern'. TZID is also set to 'US/Eastern' in the config call


$e->setProperty( 'dtstart'
, array( 'sec'=>0, 'min'=>$minute, 'hour'=>$hour, 'day'=>$day,
'month'=>$month, 'year'=>$year, 'tz' => $tz )
, array( 'TZID' => $tz ));


$e->setProperty( 'dtend'
, array( 'sec'=>0, 'min'=>$endTimeMinute, 'hour'=>$endTimeHour, 'day'=>$endTimeDay,
'month'=>$endTimeMonth, 'year'=>$endTimeYear, 'tz' => $tz )
, array( 'TZID' => $tz ));

$t = & $v->newComponent( 'vtimezone' );


$t->setProperty( 'tzid', "$tz" );


$ts = & $t->newComponent( 'standard' );


$ts->setProperty( 'dtstart'
, array( 'sec'=>0, 'min'=>$minute, 'hour'=>$hour, 'day'=>$day,
'month'=>$month, 'year'=>$year, 'tz' => "EST" ));



$ts->setProperty( 'dtend'
, array( 'sec'=>0, 'min'=>$endTimeMinute, 'hour'=>$endTimeHour, 'day'=>$endTimeDay,
'month'=>$endTimeMonth, 'year'=>$endTimeYear, 'tz' => "EST" ));



$ts->setProperty( 'tzoffsetfrom'
, '-0400' );
$ts->setProperty( 'tzoffsetto'
, '-0500' );
$ts->setProperty( 'tzname'
, 'EST' );


$td = & $t->newComponent( 'daylight' ); // initiate timezone daylight


$td->setProperty( 'dtstart'
, array( 'sec'=>0, 'min'=>$minute, 'hour'=>$hour, 'day'=>$day,
'month'=>$month, 'year'=>$year, 'tz' => "EDT" ));


$td->setProperty( 'dtend'
, array( 'sec'=>0, 'min'=>$endTimeMinute, 'hour'=>$endTimeHour, 'day'=>$endTimeDay,
'month'=>$endTimeMonth, 'year'=>$endTimeYear, 'tz' => "EDT" ));


$td->setProperty( 'tzoffsetfrom'
, '-0500' );
$td->setProperty( 'tzoffsetto'
, '-0400' );
$td->setProperty( 'tzname'
, 'EDT' );










  2. Re: Outlook start time issue   Reply   Report abuse  
Picture of Paul Gutches Paul Gutches - 2013-03-19 17:51:24 - In reply to message 1 from Paul Gutches
Ok, so.... here I am thinking I must be a bad coder because I can't get this to work, and some further research reveals that there has been some kind of bug wrt daylight savings in Outlook since 2007!

Ugh!

I guess you can all ignore this post now, unless you do still see something that's wrong here.

Thanks

Paul

  3. Re: Outlook start time issue   Reply   Report abuse  
Picture of Kjell-Inge Gustafsson Kjell-Inge Gustafsson - 2013-07-15 16:55:57 - In reply to message 1 from Paul Gutches
Try the iCalcreator function createTimezone(http://kigkonsult.se/iCalcreator/docs/using.html#createTimezone)

// Kjell_inge