Hi, As specified in the developer's guide<http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#RetrievingDateRange>, you should use:
EventQuery myQuery = new EventQuery(feedUrl); myQuery.*StartTime* = new DateTime(2007, 1, 5); myQuery.*EndTime* = new DateTime(2007, 1, 7); EventFeed myResultsFeed = myService.Query(myQuery); Best, Alain On Wed, May 25, 2011 at 11:30 PM, rootchord <[email protected]> wrote: > I'm a total n00b so please be gentle, > > I set the code to only query for events from today, but i get events from > the whole year.any ideas? > > Here's my code: > > > CalendarService myService = new CalendarService("MYAPP"); > myService.setUserCredentials("[email protected]", > "MYPASSWORD"); > FeedQuery singleQuery = new FeedQuery(); > singleQuery.Uri = new Uri(" > http://www.google.com/calendar/feeds/[email protected]/private/full"); > singleQuery.StartDate = DateTime.Now.AddDays(-1); > singleQuery.EndDate = DateTime.Now.AddDays(1); > //singleQuery.StartDate= DateTime.Today; > //singleQuery.EndDate = DateTime.Today; > AtomFeed newFeed = myService.Query(singleQuery); > if (newFeed.TotalResults != 0) > { > for (int i = 0; i < newFeed.TotalResults; i++) > { > AtomEntry retrievedEntry = newFeed.Entries[i]; > String myEntryTitle = retrievedEntry.Title.Text; > MessageBox.Show(myEntryTitle); > } > } > > -- > 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://code.google.com/apis/calendar/community/forum.html > -- Alain Vongsouvanh -- 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://code.google.com/apis/calendar/community/forum.html
