An object representing the span of time between two dates that bridges to
NSDate when you need reference semantics or other Foundation-specific behavior.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
NSDate object represents a closed interval between two dates. The
NSDate class provides a programmatic interface for calculating the duration of a time interval and determining whether a date falls within it, as well as comparing date intervals and checking to see whether they intersect.
NSDate object consists of a
start and an
end of a date interval can be equal, in which case its
end cannot occur earlier than
You can use the
Date class to create string representations of
NSDate objects that are suitable for display in the current locale.