title: Python sqlite: ValueError: invalid literal for int() with base 10: b'59+11'
body: <p>Getting errors when querying for specific dates:</p>
  
  <pre><code>sql_db = sqlite3.connect("histories.db",detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
  sql_cursor = sql_db.cursor()
  
  # sql_args printed from terminal prompt
  sql_args = ('UO9', datetime.datetime(2017, 12, 18, 13, 0, tzinfo=&lt;UTC&gt;), datetime.datetime(2018, 2, 5, 12, 59, 59, 999999, tzinfo=&lt;UTC&gt;))
  
  sql_cursor.execute("""SELECT timestamp as "[timestamp]",value FROM histories WHERE id=? AND timestamp&gt;=? AND timestamp&lt;?""", sql_args)
  </code></pre>
  
  <p>The error output is below:</p>
  
  <pre><code>  File "/usr/lib/python3.5/sqlite3/dbapi2.py", line 70, in convert_timestamp
      hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
  ValueError: invalid literal for int() with base 10: b'59+11'
  </code></pre>
  
  <p>Not sure what the problem could be here, it doesn't break all the time which is what makes it all the more confusing.</p>
  
  <p>Any ideas for how to get around this?</p>