2010/1/8 kumari nanda <[email protected]> > I am using Google calendar API. I am enable to pass start time and end time > from my application to google calendar using [when] class. > Can anyone please suggest me how the time format should be. > > Here is a code of mine . Hope this helps.
dataSDF.applyPattern("yyyy-MM-dd HH:mm:ss");
EventEntry myEntry = new EventEntry();
EventWho participant = new EventWho();
participant.setEmail(URLProf);
participant.setRel(pCourant.getUtilisateurLogin());
participant.setAttendeeStatus(Who.AttendeeStatus.EVENT_ACCEPTED);
participant.setAttendeeType(Who.AttendeeType.EVENT_REQUIRED);
participant.setImmutable(false);
myEntry.addParticipant(participant);
myEntry.setTitle(new PlainTextConstruct(title));
myEntry.setContent(new PlainTextConstruct("Auto generated by ISIN"));
calendar.setTime(cCourant.getHeureDebut());
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
DateTime startTime =
DateTime.parseDateTime(dataSDF.format(calendar.getTime()).toString().replace("
", "T"));
calendar.add(calendar.HOUR_OF_DAY, cCourant.getDuree().getHours());
calendar.add(calendar.MINUTE, cCourant.getDuree().getMinutes());
DateTime endTime =
DateTime.parseDateTime(dataSDF.format(calendar.getTime()).toString().replace("
", "T"));
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
Person author = new Person("foo", null, "bar");
myEntry.getAuthors().add(author);
EventEntry insertedEntry = myService.insert(feedUrl, myEntry);
--
Florent Devin
-- You received this message because you are subscribed to the Google Groups "Google Calendar 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-calendar-help-dataapi?hl=en.
