问题
I'm getting dates as Unix timestamps through my API and I want to convert them into NSDate objects in Swift.
How can I do that?
回答1:
Try this:
var date = NSDate(timeIntervalSince1970: timeInterval)
来源:https://stackoverflow.com/questions/26844132/how-to-convert-unix-timestamp-into-swift-nsdate-object