title: Free/busy Query
body: <p>Acording to documentation at <a href="https://developers.google.com/google-apps/calendar/v3/reference/freebusy/query" rel="nofollow noreferrer">https://developers.google.com/google-apps/calendar/v3/reference/freebusy/query</a> to perform a freebusy query you must provide this parameters in the body:</p>
  
  <pre><code>{
    "timeMin": datetime,
    "timeMax": datetime,
    "timeZone": string,
    "groupExpansionMax": integer,
    "calendarExpansionMax": integer,
    "items": [
      {
        "id": string
      }
    ]
  }
  </code></pre>
  
  <p>when building the query:</p>
  
  <pre><code># calendarlist = a list with all the ids of the calendars I do query
  # calendar is the access token to google calendar API
  start = datetime.now()
  end = start.replace(hour=23)
  freebusy_query = {
          "timeMin": start,
          "timeMax": end,
          "timeZone": 'Europe/Madrid',
          "items": calendarlist
      }
  
  availability = calendar.freebusy().query(body=freebusy_query).execute()
  </code></pre>
  
  <p>I get a response that tells me that:</p>
  
  <pre><code>TypeError: datetime.datetime(2017, 4, 14, 23, 00, 59, 999999)) is not JSON serializable
  </code></pre>
  
  <p>So I guess that my reading on the documentation is wrong and what I have to supply is a datetime string</p>
  
  <p>Am I right?</p>
  
  <p>How do I preserve the tzinfo when I transforming the datetime to a string? </p>
  
  <pre><code>date_format = '%Y-%m-%dT%H:%M:%S.%f%Z'
  start_string = start.strftime(date_format)
  ...
  </code></pre>