I'm using Java Google API client and I'm trying to create a Google Calendar Event.My authentication and calendar service initialization works (I'm able to log in and fetch my calendars events). The problem occurs when creating the event. Here is my code:
Event event = new Event();
event.setSummary( title );
event.setStart( new EventDateTime().setDate( new DateTime( new Date() ) ) );
event.setEnd( new EventDateTime().setDate( new DateTime( new Date() ) ) );
return _calendarService.events().insert( GOOGLE_CALENDAR_ID, event ).execute();
Here is the error I get:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid value for: \"T\" found, can only parse bare date string: 2014-10-10T15:58:06.165+03:00", "reason" : "invalid" } ], "message" : "Invalid value for: \"T\" found, can only parse bare date string: 2014-10-10T15:58:06.165+03:00" }
Any ideas what I'm doing wrong here?