Computes the absolute time when specified components are added to a given absolute time.
- iOS 2.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The calendar to use for the computation.
A reference to an absolute time. On input, points to the absolute time to which components are to be added; on output, points to the result of the computation.
Options for the calculation. For valid values, see Constants.
A string that describes the components provided in the vararg parameters.
Vararg parameters giving amounts of each calendrical component in the order specified by
component. The amounts to add may be negative, zero, positive, or any combination thereof.
at the computed time—if
at falls inside the defined range of the calendar and it is possible to calculate the absolute time when the components (the calendrical components specified by
component and given in the varargs) are added to the input absolute time
Some operations can be ambiguous, and the behavior of the computation is calendar-specific, but generally components are added in the order specified.
If you specify a “wrap” option (
k), the specified components should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented. When “Wrap” is false, overflow in a unit carries into the higher units, as in typical addition.
Note that some computations can take a relatively long time to perform.
The following example shows how to add 2 months and 3 days to absolute time
at‘s current value using an existing calendar (