echo date('G:i:s',mktime(0,0,round($seconds,0),0));
To do this in a single line use this. By plugging the number of seconds into mktime, you account for any timezone issues you would otherwise encounter passing the number of seconds into the date function. Since we’re not after the date itself in this instance, it’s irrelevant we’re looking at Jan 1st 1970.