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

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!!!

February 3rd, 2012 4:39am

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 19 hours 58 minutes ago
  • Unproposed as answer by Samyajit 19 hours 58 minutes ago
  • Proposed as answer by Samyajit 19 hours 52 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2012 8:54am

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.

April 22nd, 2015 7:35am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics