📜  日期格式化程序 swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.459000             🧑  作者: Mango

代码示例2
func getTimeStampDateString() -> String {
        let date = Date(timeIntervalSinceNow: self.doubleValue)
        let dateFormatter = DateFormatter()
        dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
        dateFormatter.locale = NSLocale.current
        dateFormatter.dateFormat = "d MMM HH:mm:ss"
        let strDate = dateFormatter.string(from: date)
        return strDate
    }