convert seconds in hours minutes and seconds php code example Example: seconds to minutes php echo gmdate("H:i:s", 685);