swift 10位时间戳和13位时间戳
2021-04-26 本文已影响0人
辉大大大
swift5 10位时间戳写法:(秒级)
let time = (NSDate().timeIntervalSince1970)
let timeStr = String(format:"%0.f", time)
swift5 13位时间戳写法:(毫秒级)
let time = (NSDate().timeIntervalSince1970 *1000)
let timeStr = String(format:"%0.f", time)