What is the simplest way to find the difference between 2 times in python?
<p>I have 2 time values which have the type <code>datetime.time</code>. I want to find their difference. The obvious thing to do is t1 - t2, but this doesn't work. It works for objects of type <code>datetime.datetime</code> but not for <code>datetime.time</code>. So what is the best way to do this?</p>

<p>Also a little silly, but you could try picking an arbitrary day and embedding each time in it, using <code>datetime.datetime.combine</code>, then subtracting:</p>

<pre><code>&gt;&gt;&gt; import datetime
&gt;&gt;&gt; t1 = datetime.time(2,3,4)
&gt;&gt;&gt; t2 = datetime.time(18,20,59)
&gt;&gt;&gt; dummydate = datetime.date(2000,1,1)
&gt;&gt;&gt; datetime.datetime.combine(dummydate,t2) - datetime.datetime.combine(dummydate,t1)
datetime.timedelta(0, 58675)
</code></pre>
