Skip to content

Instantly share code, notes, and snippets.

View rurza's full-sized avatar
🖥️
Working on NepTunes 4

Adam Różyński rurza

🖥️
Working on NepTunes 4
View GitHub Profile
@rurza
rurza / format-time-interval-swift.swift
Created August 31, 2019 12:53 — forked from sharat/format-time-interval-swift.swift
Format time Interval to hour, minute, second format using Swift
extension TimeInterval {
func stringFormatted() -> String {
let interval = Int(self)
let seconds = interval % 60
let minutes = (interval / 60) % 60
let hours = (interval / (60*60)) % 60
return String(format: "%02d:%02d:%02d", hours, minutes, seconds)
}
}