title: Python timedelta object with negative values
body: <p>I don't quite understand how negative arguments in <code>datetime.timedelta</code> are interpreted. </p>
  
  <p>With Positive values:</p>
  
  <pre><code>&gt;&gt;&gt; from datetime import timedelta
  &gt;&gt;&gt; d = timedelta(days=1,seconds=1,microseconds=1,milliseconds=1,minutes=1,hours=1,weeks=1)
  &gt;&gt;&gt; (d.days, d.seconds, d.microseconds)
  &gt;&gt;&gt; (8, 3661, 1001)
  </code></pre>
  
  <p>This is pretty straightforward. A similar example with negative values looks like:</p>
  
  <pre><code>&gt;&gt;&gt; from datetime import timedelta
  &gt;&gt;&gt; d = timedelta(days=-1,seconds=-1,microseconds=-1,milliseconds=-1,minutes=-1,hours=-1,weeks=-1)
  &gt;&gt;&gt; (d.days, d.seconds, d.microseconds)
  &gt;&gt;&gt; (-9, 82738, 998999) 
  </code></pre>
  
  <p>As per my understanding seconds and microseconds are derived like:</p>
  
  <ul>
  <li>seconds = <code>86399 - (-60-3600-1)</code></li>
  <li>microseconds = <code>999999 - (-1-1000)</code></li>
  </ul>
  
  <p>Is this correct? How come days equals -9?</p>
  
  <p>I am reading <a href="https://docs.python.org/3/library/datetime.html#timedelta-objects" rel="nofollow noreferrer">this</a> section of docs. But still don't quite understand the working with negative values. Please share explanations or relevant documentation links. Thanks :)</p>