swift date difference in hours code example
Example: get hours difference between two dates swift
let cal = Calendar.current
let components = cal.dateComponents([.hour], from: date2, to: date1)
let diff = components.hour!
let cal = Calendar.current
let components = cal.dateComponents([.hour], from: date2, to: date1)
let diff = components.hour!