Instance Method

getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:

Returns by reference the era, year, week of year, and weekday component values for a given date.

Declaration

- (void)getEra:(out NSInteger *)eraValuePointer yearForWeekOfYear:(out NSInteger *)yearValuePointer weekOfYear:(out NSInteger *)weekValuePointer weekday:(out NSInteger *)weekdayValuePointer fromDate:(NSDate *)date;

Parameters

eraValuePointer

Upon return, contains the era of the given date.

yearValuePointer

Upon return, contains the year of the given date.

weekValuePointer

Upon return, contains the week of the given date.

weekdayValuePointer

Upon return, contains the weekday of the given date.

date

The date for which to perform the calculation.

Discussion

Pass NULL to ignore any individual component parameter.

This is a convenience method for getting the time components of a given date using components:fromDate:

See Also

Extracting Components

- date:matchesComponents:

Returns whether a given date matches all of the given date components.

- component:fromDate:

Returns the specified date component from a given date.

- components:fromDate:

Returns the date components representing a given date.

- components:fromDate:toDate:options:

Returns the difference between two supplied dates as date components.

- components:fromDateComponents:toDateComponents:options:

Returns the difference between start and end dates given as date components.

- componentsInTimeZone:fromDate:

Returns all the date components of a date, as if in a given time zone (instead of the receiving calendar’s time zone).

- getEra:year:month:day:fromDate:

Returns by reference the era, year, week of year, and weekday component values for a given date.

- getHour:minute:second:nanosecond:fromDate:

Returns by reference the hour, minute, second, and nanosecond component values for a given date.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software