Convert Seconds to Hours Minutes Seconds Script

The Seconds to Hours Minutes Seconds Script is used to converts an seconds to hours minutes seconds.

Demo :



  Seconds
 

Example :

Type Seconds => 500

Following code is convert an seconds to hours minutes seconds script core if you need copy and use to your website.


<?php
  $sec=500;
  $seconds = round($sec);
  try{
   $dtF = new DateTime("@0");
  $dtT = new DateTime("@$seconds");
  return $dtF->diff($dtT)->format('%h:%i:%s');
  }
catch(Exception $e){
  echo $e->getMessage();
   }
?>

In the above code convert from seconds to hours minutes seconds. The DateTime function convert seconds to hours minutes seconds . The try and catch function is used to error exception for seconds to hours minutes seconds script.

Free Download Script :

If you need convert seconds to hours minutes seconds script click and download from following link.

Download