let cal = Calendar.current let components = cal.dateComponents([.hour], from: date2, to: date1) let diff = components.hour!