none
Time zone changing while updating the Appointment. RRS feed

  • Question

  • Hi,

     

    I have created the Appointment using the EWS 1.1 with (UTC-06:00) Central Time (US & Canada) time zone. When I update the appointment the time zone of the appointment changing to UTC.

    I haven’t changed any start and end times.

    Could anyone tell me what is happening.

    Regards,

    Hareen.

    Monday, April 18, 2011 1:16 PM

All replies

  • I don’t know, if i understand you right, but exchange saves appointment always in UTC, because it is possible that one exchange-server is used by users in different timezones.

    So you have always convert the times of your appointments to local time, when you receive them from exchange, because exchange doesn’t know, in witch timezone you currently are.

     

    http://msdn.microsoft.com/de-de/library/system.datetime.tolocaltime.aspx

    Tuesday, April 19, 2011 7:11 AM
  • HI,

    Thanks for reply, the Exchange server stores the times in UTC only but I am creating the appointment in CST time zone by initializing the service with CST time zone. It is showing in when section of mail & appointment as ‘When: Thursday, April 28, 2011, 12:00 AM to Friday, April 29, 2011, 12:00 AM. (UTC-06:00) Central Time (US & Canada)’ when I edit the appointment the display time zone (when part of mail & appointment) is changing to ‘When: Tuesday, April 26, 2011 5:00 AM-5:00 AM. UTC’. I am also tried by setting the service and start & end time zones to CST but no luck.

    NOTE: I am using all dates as DateTime.SpecifyKind(date,DateTimeKind.Unspecified).

    Regards,

    Hareen.


    Hareen
    Thursday, April 21, 2011 4:12 AM
  • I also tried by converting the dates to CST and updated the appointment but it is showing as UCT in when section.

     

    I also observed that the start and end are in CST only I checked by converting the when display time to CST by using the following code.

     

    Code:

    DateTime date = new DateTime(2011, 4, 30, 5, 0, 0, DateTimeKind.Utc);

    DateTime localTime = date.ToLocalTime();

    DateTime cst = TimeZoneInfo.ConvertTime(date, TimeZoneInfo.Utc, TimeZoneInfo.FindSystemTimeZoneById(“Central Standard Time

    ”));


    Hareen
    Thursday, April 21, 2011 5:12 AM
  • I had the same problem.

    The bug was not in my application or in exchange, but in windows of the client.

    TimeZoneInfo get the timezone from the registry of the client by the name of the current set timezone

    The timezones are listed in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\TimeZones

    The current set timezone is in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

     

    On some machines the current timezone is “wrong”, because the name doesn’t match to a timezone in the listed timezones. I edited the name of my current timezone in the registry, and it works. Then I google for that problem, and found a microsoft-patch like KB951793. I tried the patch, and after the patch it works too.

     

    I spend over two days to find this bug. I was really mad.

     

    Maybe this will help you.

    Thursday, April 21, 2011 6:36 AM
  • Hi,

     

    I am using the WCF services to create the appointments and the WCF services are hosted in Win 2008 Server and it’s time zone is CST. While editing I am not considering the client machine’s time zone and sending the appointment details from the Silverlight client by sending the date kind as ‘Un specified’.

     

    I have also checked the time zones of the Exchange server and it is also in CST.

     

    If I create the appointment then it is showing ‘when as CST’ in all recipients but when I edit the appointment it is showing UTC as when.

     

    Even if I run the windows application in CST time zone machine the behaviour is same.

     

    Regards,

    Hareen.


    Hareen
    Thursday, April 21, 2011 10:52 AM
  • Hi Hareen, Did you able to resolve this issue? I too facing the same issue.

    On creating an appointment, TimeZone is showing properly:

    When: Tuesday, March 27, 2012 7:00 PM-7:30 PM. (UTC-05:00) Eastern Time (US & Canada)

    But on update above appointment, TimeZone change to UTC

    When: Tuesday, March 27, 2012 11:00 PM-11:30 PM. UTC

    Note that I am not changing Start or End time while updating.

    Tuesday, March 27, 2012 7:49 PM