Returns the ordinal number of a calendrical unit within a larger unit at a specified absolute time.
- iOS 2.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The calendar to examine.
An absolute time.
The ordinal number of the calendar unit specified by
smaller within the calendar unit specified by
bigger at the absolute time
at. For example, the time 00:45 is in the first hour of the day, and for units Hour and Day respectively, the result would be 1.
bigger parameter is not logically bigger than the
smaller parameter in the calendar, or the given combination of units does not make sense (or is a computation which is undefined), the result is
The ordinality is in most cases not the same as the decomposed value of the unit. Typically return values are
1 and greater; an exception is the week-in-month calculation, which returns
0 for days before the first week in the month containing the date. Note that some computations can take a relatively long time to perform.