title: FastAPI: datetime with timezone in request doesn't work
body: <pre><code>from fastapi import FastAPI
  from datetime import datetime
  from ..models import Contact
  from ..database import Database
  
  
  app = FastAPI()
  
  # Dependency
  def get_db():
      db = Database()
      try:
          yield db
      finally:
          db.disconnect()
  
  @app.get(&quot;/contacts/&quot;, response_model=List[Contact])
  async def get_contacts(address: int, start_time: datetime, end_time: datetime, duration: int, distance: int, db: Database = Depends(get_db)):
      contacts = detect_contacts(db, address, start_time, end_time, duration, distance)
      return contacts
  </code></pre>
  <p>I'm trying to get query parameters start_time and end_time as datetime values with timezone, based on ISO 8601 or RFC 3339.
  It works fine without timezone, for example, &quot;2021-01-19 16:00:00&quot; or &quot;2021-01-19T16:00:00&quot;, but not with timezone, for example, &quot;2021-01-19 16:00:00+05:00&quot; or &quot;2021-01-19T16:00:00+05:00&quot;, returning such error:</p>
  <pre><code>{
      &quot;detail&quot;: [
          {
              &quot;loc&quot;: [
                  &quot;query&quot;,
                  &quot;start_time&quot;
              ],
              &quot;msg&quot;: &quot;invalid datetime format&quot;,
              &quot;type&quot;: &quot;value_error.datetime&quot;
          }
      ]
  }
  </code></pre>
  <p>FYI, it's explicitly mentioned in the documentation that it supports ISO 8601 format for datetime.datetime type:</p>
  <p><a href="https://fastapi.tiangolo.com/tutorial/extra-data-types/" rel="nofollow noreferrer">Extra Data Type - FastAPI</a></p>