user990016
user990016

Reputation: 3378

EWS API set time zone for appointments

Okay, let's start from scratch on this subject. I'm using Coldfusion 9, Exchange 2013, and EWS API 2.0. I can connect and add a calendar event without time zone being specified. The user I'm adding the event for is on the east coast. I can tell from his record in a table where the values are 0=CST and 1=EST.

<cfobject type="Java" class="microsoft.exchange.webservices.data.TimeZoneDefinition" name="timezoneinfo">
<cfset timezoneinfo.init( service )>

appointment.StartTimeZone = timezoneinfo.FindSystemTimeZoneById("Eastern Standard Time");

The error is; java.lang.ClassNotFoundException: microsoft.exchange.webservices.data.TimeZoneDefinition

There is no clear cut definition on how to do what I need. If I leave out the time zone code, an appointment for 9:00 AM is added to the calendar for 5:00 AM.

Upvotes: 1

Views: 2694

Answers (1)

Jason Johnston
Jason Johnston

Reputation: 17692

Ah I think I see the problem. TimeZoneDefinition is not a class in the Microsoft.Exchange.WebServices.Data namespace. The Appointment.StartTimeZone property is a System.TimeZoneInfo object.

I'm not familiar with ColdFusion, and I'm a novice with Java, but I'm guessing that the first line of your code above is the one causing the error.

Edit: As I re-read this, I think you're using the EWS Java API, not the EWS Managed API. In that case TimeZoneDefinition is a class in the library. I'm not familiar enough with the Java API to give you a sample of using it though. There is some information that seems relevant in this thread though. Hope that helps!

Upvotes: 2

Related Questions