//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 = timeStamp - days*24*3600-hours*3600-minute*60
let timeString = String.init(format: "%d天%d小时%d分%d秒", days,hours,minute,second)
return timeString
}
网友评论