title: Is a day always 86,400 epoch seconds long?
body: <p>While reviewing my past answers, I noticed I'd proposed code such as <a href="https://stackoverflow.com/questions/5868130/generating-all-dates-within-a-given-range-in-python/5868214#5868214">this</a>:</p>
  
  <pre><code>import time
  
  def dates_between(start, end):
    # muck around between the 9k+ time representation systems in Python
    # now start and end are seconds since epoch
  
    # return [start, start + 86400, start + 86400*2, ...]
    return range(start, end + 1, 86400)
  </code></pre>
  
  <p>When rereading this piece of code, I couldn't help but feel the ghastly touch of <a href="http://msmvps.com/blogs/jon_skeet/archive/2009/11/02/omg-ponies-aka-humanity-epic-fail.aspx" rel="noreferrer">Tony the Pony</a> on my spine, gently murmuring "leap seconds" to my ears and other such terrible, terrible things.</p>
  
  <p>When does the "a day is 86,400 seconds long" assumption break, for epoch definitions of 'second', if ever? (I assume functions such as Python's <a href="http://docs.python.org/library/time.html#time.mktime" rel="noreferrer"><code>time.mktime</code></a> already return DST-adjusted values, so the above snippet should also work on DST switching days... I hope?)</p>