Swift 3更新:let date = Date()let calendar = Calendar.currentlet hour = calendar.component(.hour, from: date)let minutes = calendar.component(.minute, from: date)我这样做:let date = NSDate()let calendar = NSCalendar.currentCalendar()let components = calendar.components(.CalendarUnitHour | .CalendarUnitMinute, fromDate: date)let hour = components.hourlet minutes = components.minute与Nate的答案相比,你会得到这个数字,而不是字符串...选择你的选择!