Returns the difference between two dates specified as
- iOS 8.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 6.0.1+
- Mac Catalyst 13.0+Beta
Which components to compare.
The starting date components.
The ending date components.
The result of calculating the difference from start to end.
For components which are not specified in each
Date, but required to specify an absolute date, the base value of the component is assumed. For example, for an
Date with just a
year and a
month specified, a
day of 1, and an
nanosecond of 0 are assumed. Calendrical calculations with unspecified
year value prior to the start of a calendar are not advised. For each
Date, if its
time property is set, that time zone is used for it. If the
calendar property is set, that is used rather than the receiving calendar, and if both the
time are set, the
time property value overrides the time zone of the