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
In reply to Re: Time string with addition
by moggs
in thread Time string with addition
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |