title: php - seconds to time left?
body: <p>I'm trying to format a date to say how much time is left (in a readable format) from how many seconds are left:</p>
  
  <pre><code>&lt;?php
      $seconds = 23414;
      $date = new DateTime();
      $date-&gt;setTime(0, 0, $seconds);
      echo $date-&gt;format('z G:i:s');
  ?&gt;
  </code></pre>
  
  <p>This example might output something like: <code>344 11:46:45</code> which is not what I'd like. It should say something like <code>6 days, 4:12:36</code>. I just don't see anything here: <a href="http://www.php.net/manual/en/function.date.php" rel="nofollow">http://www.php.net/manual/en/function.date.php</a> that would help me format it correctly. Ideas?</p>