How to convert from NSDate(timeIntervalSince1970 to NSDate()?
问题 This is my code. But an error said, cannot invoke dateComponent with an argument list of type... let fromDate = NSDate(timeIntervalSince1970: TimeInterval(tweetsArray[indexPath.row].timestamp)!) let toDate = NSDate() let components : NSCalendar.Unit = [.second, .minute, .hour, .day, .weekOfMonth] let differenceOfDate = NSCalendar.current.dateComponents(components, from: fromDate, to: toDate) 回答1: In Swift 3, NSCalendar.current returns a Calendar , which is the Swift value wrapper type for the