A specific point in time, independent of any calendar or time zone.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Date value encapsulate a single point in time, independent of any particular calendrical system or time zone. Date values represent a time interval relative to an absolute reference date.
Date structure provides methods for comparing dates, calculating the time interval between two dates, and creating a new date from a time interval relative to another date. Use date values in conjunction with
Date instances to create localized representations of dates and times and with
Calendar instances to perform calendar arithmetic.
Date bridges to the
NSDate class. You can use these interchangeably in code that interacts with Objective-C APIs.