none
StartTimeZone required when setting the Start, End, IsAllDayEvent, or Recurrence properties. RRS feed

  • Question

  • I am trying to schedule a meeting with Exchange 2007 SP1 using EWS Java API 1.1.3.  I created my ExchangeService object like:

    s = new ExchangeService(ExchangeVersion.Exchange2007_SP1)

    However when I run my code to schedule a meeting I get the error mentioned in the topic.  So I tried to set the startTimeZone:

    mtg.setStartTimeZone(new TimeZoneDefinition(){{setId("UTC");}});
    mtg.setStart(stime);
    mtg.setEnd(etime);

    And get an error saying the timezone is invalid.  I read in another thread that all the timezonedefinitions are invalid and not to use setStartTimeZone.  What do I need to do to get my code to work?  Thanks in advance.

    Thursday, February 16, 2012 7:09 PM

All replies

  • Same problem for me.... nobody can help us ?

    I tried several possibilities but no one work, for example :

    Appointment appointment= new Appointment(getStub());
    Calendar cstart = Calendar.getInstance(), cend = Calendar.getInstance();
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date startTime = dateFormat.parse("2013-12-8 16:00:00");
    Date endTime = dateFormat.parse("2013-12-9 18:00:00");
    cstart.setTime(startTime);
    cend.setTime(endTime);
    appointment.setStart(startTime);
    appointment.setEnd(endTime);
    appointment.save();

    I tried to set the timezone like that :

    TimeZoneDefinition tzd = new TimeZoneDefinition(){{
    		        setName( "(GMT+01:00) Bruxelles, Copenhague, Madrid, Paris" );
    		    }};

    or

    TimeZoneDefinition tzd = (TimeZoneDefinition) ((ArrayList)this.getStub().getServerTimeZones()).get(332);
    but nothing can fix the problem...

    Error message :

    microsoft.exchange.webservices.data.ServiceLocalException: StartTimeZone required when setting the Start, End, IsAllDayEvent, or Recurrence properties.  You must load or assign this property before attempting to update the appointment.
        at microsoft.exchange.webservices.data.Appointment.validate(Appointment.java:249)


    Thanks in advance


    Friday, December 6, 2013 8:49 AM
  • I know the thread is old but I've got here, so others may come as well...

    You can get a list of all time zones with service.getServerTimeZones() or only a subset: 

    service.getServerTimeZones(Collections.singletonList("Europe/Berlin"))

    As a note: using ExchangeVersion.Exchange2010_SP2 I don't have to set the timezone and  the java.util.Date values will be treated as UTC (AFAIK).

    Wednesday, September 24, 2014 9:36 AM