public static function secToTime($sec)
    {
        // int sec
        $hour    = (int)floor($sec / 3600);
        $minutes = (int)floor(($sec % 3600) / 60);
        $second  = (int)$sec - (($hour * 3600) + ($minutes * 60));

        if ($hour <= 9) {
            $hour = '0' . $hour;
        }
        if ($minutes <= 9) {
            $minutes = '0' . $minutes;
        }
        if ($second <= 9) {
            $second = '0' . $second;
        }

        return $hour . ':' . $minutes . ':' . $second; // return hh:mm:ss
    }