//
//  ZZHHelper.swift
//  SwiftProject
//
//  Created by aaa on 2024/3/11.
//

import Foundation
class ZZHHelper {
    class func formatVideoTime(second:Int) -> String {
        let allTime: Int = second
        var hours = 0
        var minutes = 0
        var seconds = 0
        var hoursText = ""
        var minutesText = ""
        var secondsText = ""
        
        hours = allTime / 3600
        hoursText = hours > 9 ? "\(hours)" : "0\(hours)"
        
        minutes = allTime % 3600 / 60
        minutesText = minutes > 9 ? "\(minutes)" : "0\(minutes)"
        
        seconds = allTime % 3600 % 60
        secondsText = seconds > 9 ? "\(seconds)" : "0\(seconds)"
        
        if hoursText == "00" {
            return "\(minutesText):\(secondsText)"
        }else{
            return "\(hoursText):\(minutesText):\(secondsText)"
        }
    }
}
