Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func getTimeStamp(millisec):
- var seconds = (millisec / 1000)
- var minutes = floor(seconds / 60)
- var hours = 0
- if minutes > 59:
- hours = floor(minutes / 60)
- minutes = minutes - (hours * 60)
- seconds = floor(seconds % 60)
- var str_hours = str(hours) if (hours >= 10) else "0" + str(hours)
- var str_mins = str(minutes) if (minutes >= 10) else "0" + str(minutes)
- var str_secs = str(seconds) if (seconds >= 10) else "0" + str(seconds)
- if hours != 0:
- return str_hours + ":" + str_mins + ":" + str_secs
- return str_mins + ":" + str_secs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement