I'm trying to use the Google Calendar API in my own Java class. Unfortunately, the endTime of the newly created event (vacation in this case) seems to decremented by 1 day.
Example: I create an event with startTime 2011-01-01 and endTime 2011-01-05 the event will show up in Google Calendar from 2011-01-01 to 2011-01-04.
This is what I got so far (just the date part, taken from the Google Calendar API Developer's Guide, changed to Date because I want All Day events):
...
CalendarEventEntry myEntry = new CalendarEventEntry();
DateTime startTime = DateTime.parseDate("2011-01-01");
DateTime endTime = DateTime.parseDate("2011-01-05");
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
Reminder reminder = new Reminder();
reminder.setMethod(Method.NONE);
myEntry.getReminder().add(reminder);
CalendarEventEntry insertedEntry = myService.insert(postUrl, myEntry);
...
Could this be somehow related to timezone issues? (I am from Germany)