//MARK: -时间戳转时间函数
func timeStampToString(timeStamp: Int)->String {
///天
let days = Int(timeStamp/(3600*24))
///时
let hours = Int((timeStamp - days*24*3600)/3600)
///分
let minute = Int((timeStamp - days*24*3600-hours*3600)/60)
///秒
let second = Int((timeStamp - days*24*3600-hours*3600) - 60*minute)
let timeString = String.init(format: "%d:%d",hours,minute)
return timeString
}
网友评论