Closed iT-Boyer closed 2 years ago
let duration = fmtCtx.duration/1000000 duration.secondsToTime()
extension Int64 { func secondsToTime() -> String { let (h,m,s) = (self / 3600, (self % 3600) / 60, (self % 3600) % 60) let h_string = h < 10 ? "0\(h)" : "\(h)" let m_string = m < 10 ? "0\(m)" : "\(m)" let s_string = s < 10 ? "0\(s)" : "\(s)" return "\(h_string):\(m_string):\(s_string)" } }