Hello fellow GData users,
I ran across a problem while implementing a Java Client App using the
Google Calendar API. When I try to insert an event at 6:30pm on Oct
31. of this year I end up with an event at 7:30pm instead. It seemed
like a TimeZone daylight savings problem to me...but all of my
entities are in the EST timezone. Example code:
URL targetCalendarUrl = new
URL(targetCalendar.getLink(Link.Rel.ALTERNATE,
Link.Type.ATOM).getHref());
CalendarEventEntry myEntry = new CalendarEventEntry();
myEntry.setTitle(new PlainTextConstruct("Tennis with Beth"));
myEntry.setContent(new PlainTextConstruct("Meet for a quick
lesson."));
TimeZone tz = TimeZone.getTimeZone("EST");
SimpleDateFormat dateParser = new SimpleDateFormat("yyyy MMM.
dd hh:mmaa");
DateTime startDateTime = new DateTime(dateParser.parse("2007
OCT. 31 6:30pm"), tz);
DateTime endDateTime = new DateTime(dateParser.parse("2007
OCT. 31 7:50pm"), tz);
When eventTimes = new When();
eventTimes.setStartTime(startDateTime);
eventTimes.setEndTime(endDateTime);
myEntry.addTime(eventTimes);
// Send the request and receive the response:
CalendarEventEntry insertedEntry =
myService.insert(targetCalendarUrl, myEntry);
Expected results from executing this against a valid targetCalendar
would be to have the event insert itself at 6:30pm. Instead I'm
seeing the event created at 7:30pm. Other dates (before and after)
seem to be working correctly. Am I missing something simple? Any
help is appreciated!
Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---