title: How to return ALL events in a Google Calendar without knowing whether it is a timed or all day event
body: <p>Now, I'm working on making a program in Python that can pull events from all the calendars in my Google account; however, I'm trying to make the program potentially as commercial as possible.  With that said, it's quite simple to customize the code for myself, when I know that all the US Holidays events attached to my calendar are all day events, so I can set up a simple if statement that checks if it's a Holiday calendar and specify the events request as such:</p>
  
  <pre><code>def get_main_events(pageToken=None):
    events = gc_source.service.events().list(
      calendarId=calendarId,
      singleEvents=True,
      maxResults=1000,
      orderBy='startTime',
      pageToken=pageToken,
      ).execute()
    return events
  </code></pre>
  
  <p>So, that works for all day events.  After which I'd append the results to a list and filter it to get only the events I want.  Now getting events from my primary calendar is a bit easier to specify the events I want because they're generally not all day events, just my work schedule so I can use:</p>
  
  <pre><code>now = datetime.now()
  now_plus_thirtydays = now + timedelta(days=30)
  def get_main_events(pageToken=None):
    events = gc_source.service.events().list(
      calendarId=calendarId,
      singleEvents=True,
      maxResults=1000,
      orderBy='startTime',
      timeMin=now.strftime('%Y-%m-%dT%H:%M:%S-00:00'),
      timeMax=now_plus_thirtydays.strftime('%Y-%m-%dT%H:%M:%S-00:00'),
      pageToken=pageToken,
      ).execute()
    return events
  </code></pre>
  
  <p>Now, the problem I run into with making the program available for commercial use, as well as myself, is the above will ONLY return NON-all day events from my primary calendar.  I'd like to find out if there's a way - if so, how - to run the get events request and return ALL results whether they're all day or if they're just a timed event that takes place in a portion of the day.  In addition part of this issue is that in another part of the code where I print the results I would need to use:</p>
  
  <pre><code>print event['start']['date']
  </code></pre>
  
  <p>for an all day event, and:</p>
  
  <pre><code>print event['start']['dateTime']
  </code></pre>
  
  <p>for a non all day event.</p>
  
  <p>So, since 'dateTime' wont work on an all day event, I'd like to figure out a way to set it up so that I can evaluate whether an event is all day or not.  i.e. "if said event is an all day event, use event['start']['date'], else use event['start']['dateTime']  </p>