in reply to Time string with addition

The modulo operator will be your key here:

$in = 391; $hour = sprintf("%02d", int($in / 3600)); $min = sprintf("%02d", int($in / 60)); $sec = sprintf("%02d", $in % 60); print "$in .. $hour:$min:$sec\n";

However, I agree with the idea of letting SQL handle the complexities of dates and times - being as it's in use anyway.

Moggs