title: What is the standard way to add N seconds to datetime.time in Python?
body: <p>Given a <code>datetime.time</code> value in Python, is there a standard way to add an integer number of seconds to it, so that <code>11:34:59</code> + 3 = <code>11:35:02</code>, for example?</p>
  
  <p>These obvious ideas don't work:</p>
  
  <pre><code>&gt;&gt;&gt; datetime.time(11, 34, 59) + 3
  TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int'
  &gt;&gt;&gt; datetime.time(11, 34, 59) + datetime.timedelta(0, 3)
  TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta'
  &gt;&gt;&gt; datetime.time(11, 34, 59) + datetime.time(0, 0, 3)
  TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.time'
  </code></pre>
  
  <p>In the end I have written functions like this:</p>
  
  <pre><code>def add_secs_to_time(timeval, secs_to_add):
      secs = timeval.hour * 3600 + timeval.minute * 60 + timeval.second
      secs += secs_to_add
      return datetime.time(secs // 3600, (secs % 3600) // 60, secs % 60)
  </code></pre>
  
  <p>I can't help thinking that I'm missing an easier way to do this though.</p>
  
  <h3>Related</h3>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/656297/python-time-timedelta-equivalent">python time + timedelta equivalent</a></li>
  </ul>