EWS Managed API - timezone discrepancy RRS feed

  • Question

  • Started using the Exchange Web Service to get peoples availability (if they are out of office).  This is working fine; however, when we verify against our calendars it appears it is using GMT.  If my parameters are a 24 hour block, it is taking 6 hours (6:00pm) into the previous day (I am Central Standard Time).  I have found the documentation regarding how it has to be a 24 hour block and starts at 12:00am.  I have also found documentation that it should be able to manage our timezone...yet it is still returing out of office users from prior day after 6:00pm.  Any help is greatly appreciated.

    Some code pieces:

    TimeZone tz = TimeZone.getTimeZone("Central Standard Time");
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010,tz);

    TimeWindow tw = new TimeWindow(startDate, endDate);

    GetUserAvailabilityResults freeBusyResults = service.getUserAvailability(attendees, tw, AvailabilityData.FreeBusy, aoptions);


    Tuesday, February 19, 2013 8:51 PM

All replies

  • Try with d following things.

    DateTime startTime = new DateTime(2013, 2, 26, 7, 0, 0, DateTimeKind.Local);

    DateTime startTime = new DateTime(2013, 2, 26, 7, 0, 0).ToLocalTime();

    ranjeet k

    Tuesday, February 26, 2013 1:22 PM