none
EWS Managed API-How do I set the start time zone? RRS feed

  • Question

  • I am using EWS Managed API 1.1.3 with java and exchange 2010.  I live in the United States Pacific Time Zone.  Every time I schedule a meeting it tries to convert my time to pacific time, subtracting the time I give it by 8 hours!  I want it just to take my time as pacific time and not touch it. 

    First I tried to set the time zone in the constructor of my service object:

    s = new ExchangeService(ExchangeVersion.Exchange2010, TimeZone.getTimeZone("America/Los_Angeles"));

    This didn't do anything for some reason.

    Then I tried setting the start time zone:

    mtg.setStartTimeZone(new TimeZoneDefinition(){{setId("America/Los_Angeles");}});

    And I got an error saying unrecognized time zone.

    Can somebody please help me with this?  It's urgent!!!

    Friday, February 3, 2012 4:39 AM

All replies

  • I figured it out.  I need to add the following line before I set any dates or times:

    TimeZone.setDefault(TimeZone.getTimeZone("UTC"));

    • Proposed as answer by Samyajit Wednesday, April 22, 2015 11:28 AM
    • Unproposed as answer by Samyajit Wednesday, April 22, 2015 11:29 AM
    • Proposed as answer by Samyajit Wednesday, April 22, 2015 11:34 AM
    Friday, February 3, 2012 8:54 AM
  • Thanks EWS API 1.2 for Java cannot interpret UTC time even if timezone is mentioned like 2015-04-22 11:32:13Z. So it is necessary to set the default timezone as you mentioned above.

    Wednesday, April 22, 2015 11:34 AM