What are the limitations of using custom functions like time_convert in PHP for converting time values to the format 00:00:00, especially when dealing with values exceeding 86400 seconds?

When dealing with time values exceeding 86400 seconds (24 hours), custom functions like time_convert in PHP may not accurately convert the time to the format 00:00:00. This is because the function may not account for values greater than a day and may incorrectly calculate the hours, minutes, and seconds. To solve this issue, you can use the PHP DateTime class, which handles date and time values accurately, including values exceeding 86400 seconds.

function convertTime($seconds) {
    $dtF = new DateTime('@0');
    $dtT = new DateTime("@$seconds");
    return $dtF->diff($dtT)->format('%H:%I:%S');
}

$time_in_seconds = 100000;
echo convertTime($time_in_seconds); // Output: 27:46:40