Returns a date representing the absolute time calculated from given components.
- iOS 2.0+
- macOS 10.4+
- tvOS 9.0+
- watchOS 2.0+
The components from which to calculate the returned date.
NSDate object representing the absolute time calculated from
nil if the receiver cannot convert the components given in
comps into an
When there are insufficient components provided to completely specify an absolute time, a calendar uses default values of its choice. When there is inconsistent information, a calendar may ignore some of the components parameters or the method may return
nil. Unnecessary components are ignored (for example, Day takes precedence over Weekday and Weekday ordinals).
The following example shows how to use this method to create a date object to represent 14:10:00 on 6 January 1965, for a given calendar (
Note that some computations can take a relatively long time to perform.