Negative time zone leads to incorrect start date of a recurring event?

7 views
Skip to first unread message

Bogdan Lavryshchuk

unread,
Dec 21, 2014, 5:08:40 AM12/21/14
to jec-u...@googlegroups.com
Hello.

If I set my computer to use negative time zone then recurring event starts one day earlier. Could you help me with that? Thanks.

Steps:
1. Set machine running ewjs to non-negative timezone (I used +1);
2. Create recurring event with example app;
3. Open Outlook web app and check that recurrence starts from December 31;
4. Remove event;
5. Set machine running ewjs to negative timezone (I used -1 and -8);
6. Create recurring event with same example app;
7. Open Outlook web app and check the result: recurrence starts from December 30;

Expected: recurrence still starts from December 31;
   
Machine: 10.10.1, Exchange: 2010.

      EWSConnectorFactory factory = new EWSConnectorFactory();

       
EWSConnectorInterface connector = null;
        connector
= factory.createEWSConnector(_exchangeHost,
                                               _userName
,
                                               _password
,
                                               _prefix
, _useSSL, _accountName);
       
       
SimpleDateFormat dateFormat = new SimpleDateFormat(
               
"yyyy-MM-dd HH:mm:ss");
       
Date startDate = null;
       
Date endDate = null;
        startDate
= dateFormat.parse("2014-12-31 23:00:00");
        endDate
= dateFormat.parse("2014-12-31 23:30:00");
       
EWSEventDTO event = new EWSEventDTO();
       
event.setSubject("test event2");
       
event.setStartDate(startDate);
       
event.setEndDate(endDate);
       
       
String xmlRecurrenceRule = "<t:Recurrence><t:DailyRecurrence><t:Interval>1</t:Interval>"
               
+ "</t:DailyRecurrence><t:NumberedRecurrence>"
               
+ "<t:StartDate>2014-12-31Z</t:StartDate>"
               
+ "<t:NumberOfOccurrences>5</t:NumberOfOccurrences>"
               
+ "</t:NumberedRecurrence></t:Recurrence>";
       
EWSRecurrence ewsRecurrence = new EWSRecurrence( xmlRecurrenceRule );
       
event.setRecurrenceRule( ewsRecurrence );
       
event.setRecurrent( true );


   
String[] result = null;
 
try {
 result
= connector.createEvent(event);
 
System.out.println("id: " + result[0]);
       
System.out.println("changeKey: " + result[1]);
 
} catch (Exception e) {
 e
.printStackTrace();
 
}

jonathan sanders

unread,
Dec 22, 2014, 10:45:01 AM12/22/14
to jec users2

Hi,
Try to update the event to add timezone.
Please see the related timezone examples.

Best Regards,
Jonathan Sanders,
NetComps LTD

--
You received this message because you are subscribed to the Google Groups "jec users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jec-users2+...@googlegroups.com.
To post to this group, send email to jec-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/jec-users2.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages