title: how to calculate hours,minutes and seconds from total minutes in php?
body: <p>I am developing one website in php.</p>
  
  <p>I need to add jobs to the sql server 2008 database.</p>
  
  <p>I am taking job duration in minutes and i want to convert it in to H:i:s format.</p>
  
  <p>I am using this code :</p>
  
  <pre><code>  $hours = (int)($duration / 60);
    $minutes = $duration - ($hours * 60);
    $time = $hours.":".$minutes;
  </code></pre>
  
  <p>It works fine with int duration 30,60,100,120 etc.</p>
  
  <p>but if duration is 1.33 or 5.40 than the output should be 00:01:30 or 00:05:40 respectively.</p>
  
  <p>How can i do this ?</p>