Adding datetime.time objects to each other in python
<p>How can i add datetime.time objects to each other? Lets say i have:</p>

<pre><code>import datetime as dt

a = dt.time(hour=18, minute=15)
b = dt.time(hour=0, minute=15)

#c = a+b???
</code></pre>

<p>c should be equal to <code>datetime.time(hour=18, minute=30)</code></p>

<p>Edit:</p>

<p>I have a function that gets as arguments datetime.time objects and should return datetime.time object that is sum of passed arguments. As i am only dealing with hours and minutes i wrote this:</p>

<pre><code>def add_times(t1, t2):
    hours = t1.hour + t2.hour
    minutes = t1.minute + t2.minute
    hours += minutes // 60
    minutes %= 60
    new_time = datetime.time(hour=hours, minute=minutes)
    return new_time
</code></pre>

<p>But it is a dirty way and i am sure there is a legit way of doing it.</p>

<p>How do i achieve that?</p>