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