I take it kb/sec stands for kilobit/second and that the file size is given in bytes? When you have both the file size and data rate in the same units, you get the time it takes to download the whole file in seconds:

$download_time = $file_size / $data_rate

$hours = floor($download_time / 3600)

$remainder = $download_time - $hours * 3600

$minutes = floor($remainder / 60)

$seconds = $remainder - $minutes * 60