title: Convert seconds to human readable time duration
body: <p>How would I best convert 90060 (seconds) to a string of "25h 1m"?</p>
  
  <p>Currently I'm doing this in SQL:</p>
  
  <pre><code>SELECT 
    IF(
      HOUR(
        sec_to_time(
          sum(time_to_sec(task_records.time_spent))
        )
      ) &gt; 0, 
      CONCAT(
        HOUR(sec_to_time(sum(time_to_sec(task_records.time_spent)))), 
        'h ', 
        MINUTE(sec_to_time(sum(time_to_sec(task_records.time_spent)))),
        'm'
      ), 
      CONCAT(
        MINUTE(sec_to_time(sum(time_to_sec(task_records.time_spent)))),
        'm'
      )
    ) as time
  FROM myTable;
  </code></pre>
  
  <p>But I'm not sure it's the most convenient method :-)</p>
  
  <p>I'm open to suggestions on doing this both in SQL (differently than I'm already doing) or in PHP.</p>
  
  <p>EDIT:</p>
  
  <p>Examples of desired strings: "5m", "40m", "1h 35m", "45h" "46h 12m".</p>