how to find difference between two dates in swift?
The hour property on diffComponents will give you the number of full hours between two dates. This means that a difference of two and a half hours will be reported as two. If the dates are two and a half hours apart, this would give you 2 for the hour component, and 30 for the minute component.