SwiftDate
时间相减 计算 时间差
let date1Str = "2016/09/30"
let date2Str = "2021/12/01"
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy/MM/dd"
let date1 = dateFormatter.date(from: date1Str)
let date2 = dateFormatter.date(from: date2Str)
//
// dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
let timeNumber = date1!.timeIntervalSince1970
let timeNumber2 = date2!.timeIntervalSince1970
print( "==================")
print(timeNumber)
print(timeNumber2)