locked
Outlook Calender ICS file RRS feed

  • Question

  • User-1294392548 posted

    Ok, this one has me stumped.  An event (for Jan 07th, 2007) was added to our Club Starter Kit based site.  The event is accurately listed with a start time of 12:00pm (Noon) and an end time of 2:00pm.   (I'm in Eastern Time Zone, by the way). When I click on the link to download the Calendar event to Outlook, it is coming up in my calender with a 2pm start time and a 4pm end time; so both are off by exactly 2 hours. 

    When I look at the .ICS file in Notepad it has the following information for this event.

        DTEND:20070107T210000Z
        DTSTART:20070107T190000Z

    So I'm assuming we are talking times relative to GMT?  But we in the Eastern Time Zone are 5 hours diff from GMT.  So the times I would expect in the ICS file would be DTStart of 170000 and DTEnd of 190000 

    So questions are, is this line: 

        endtime.ToUniversalTime.ToString("yyyyMMddTHHmmss") & "Z"

     actually relative to GMT?  What is Coordinated Universal Time (UTC) as it talks about in Help?

    What should I do to fix it?  Is it safe just to add the 2 hours in the code that creates the ICS using the DateAdd function?

    PS: I don't actually know who created the event, and it could be that they were traveling to a different timezone and don't use/understand the concept of changing their system clock while traveling...could this explain it all away?   I looked at SQL and the DB says the event has a start of 1/7/2007 12:00:00 PM and an end time 1/7/2007 02:00:00 PM so I don't think the traveling is really the problem.

     Thanks.

    Wednesday, January 3, 2007 5:54 PM

Answers

  • User523970105 posted

    This problem is typically caused by the host being in a different time zone than the client.  I don't have the code in front of me now, but here's what I think is happening:

     1) Someone enters a new event, specifying a start and stop time *without specifying which time zone*.  These non-timezone-specific times get saved into the database as-is

    2) When anyone requests an ICS file, the code converts the stored times to UTC using the host computers timezone setting and puts the converted times into the ICS file.

    3) When the client computer receives the ICS file, the UTC times are converted to local time using the client computer timezone setting.

    There isn't a simple solution because requirements differ.  If you have clients in many time zones, a simple solution would be to put a big notice in the events creation page to please enter times in whatever time zone your host is set to.  For example, if you host is on the west coast ask folks to enter event times in Pacific time.

    In my case, however, all of my clients tend to be in the Central time zone, yet my host is in the Pacific time zone.  I modified the code to apply a 2-hour offset to the ICS file to "hide" the difference.  I then put a note on my calendar page that all event times are in Central.

    A fully robust solution would be to specify time zone with each event (would require a new field in the database and GUI changes to allow it to be set.  Then the code that creates the ICS file could do the correct conversion to UTC.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 4, 2007 2:13 PM

All replies

  • User523970105 posted

    This problem is typically caused by the host being in a different time zone than the client.  I don't have the code in front of me now, but here's what I think is happening:

     1) Someone enters a new event, specifying a start and stop time *without specifying which time zone*.  These non-timezone-specific times get saved into the database as-is

    2) When anyone requests an ICS file, the code converts the stored times to UTC using the host computers timezone setting and puts the converted times into the ICS file.

    3) When the client computer receives the ICS file, the UTC times are converted to local time using the client computer timezone setting.

    There isn't a simple solution because requirements differ.  If you have clients in many time zones, a simple solution would be to put a big notice in the events creation page to please enter times in whatever time zone your host is set to.  For example, if you host is on the west coast ask folks to enter event times in Pacific time.

    In my case, however, all of my clients tend to be in the Central time zone, yet my host is in the Pacific time zone.  I modified the code to apply a 2-hour offset to the ICS file to "hide" the difference.  I then put a note on my calendar page that all event times are in Central.

    A fully robust solution would be to specify time zone with each event (would require a new field in the database and GUI changes to allow it to be set.  Then the code that creates the ICS file could do the correct conversion to UTC.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 4, 2007 2:13 PM
  • User-1294392548 posted

    Thank you typhoid.  That appears to have done the trick!!!!

    Much appreciated. 

    Tuesday, January 9, 2007 11:13 PM