title: combining datetime.datetime with datetime.time - TypeError: an integer is required
body: <p>I am currently attempting to iterate through some data contained in an SQL request cursor, alter the type of some of the data into "datetime.time" and then combine that with another variable into a new variable named "datetime_db".</p>
  
  <p>I have two variables named "date" and "nextDay" which have been previously defined earlier in my code. The previously mentioned "datetime.time" will be combined with either "date" or "nextDay" depending on certain conditions.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>for (date_db,time_db,price) in cursor:
      time_db = datetime.datetime.strptime(time_db,"%H:%M:%S").time()
      price = float(price)
  
      if (date_db == date):
          datetime_db = datetime.datetime.combine(datetime.date(date), datetime.time(time_db))
  
      else:
          datetime_db = datetime.datetime.combine(datetime.date(nextDay), datetime.time(time_db))
  </code></pre>
  
  <p>This throws up the following error:</p>
  
  <pre><code>File "C:/Users/Stuart/PycharmProjects/untitled/Apache - Copy.py", line 82, in &lt;module&gt;
  datetime_db = datetime.datetime.combine(datetime.date(date), datetime.time(time_db))
  TypeError: an integer is required
  </code></pre>
  
  <p>When I print out the "type()" for the 3 variables involved I get the following:</p>
  
  <pre><code>time_db = &lt;type 'datetime.time'&gt; date = &lt;type 'datetime.datetime'&gt; nextDay = &lt;type 'datetime.datetime'&gt;
  </code></pre>
  
  <p>Is there any obvious reason why this is not working? I have tried changing the type of "date" and "nextDay" to a "datetime.date" but that makes no difference.</p>
  
  <p>Could someone suggest how I may combine these two variables successfully?</p>