Instance Method

dateWithEra:year:month:day:hour:minute:second:nanosecond:

Returns a date created with the given components.

Declaration

- (NSDate *)dateWithEra:(NSInteger)eraValue year:(NSInteger)yearValue month:(NSInteger)monthValue day:(NSInteger)dayValue hour:(NSInteger)hourValue minute:(NSInteger)minuteValue second:(NSInteger)secondValue nanosecond:(NSInteger)nanosecondValue;

Parameters

eraValue

The value to set for the era.

yearValue

The value to set for the year.

monthValue

The value to set for the month.

dayValue

The value to set for the day.

hourValue

The value to set for the hour.

minuteValue

The value to set for the minute.

secondValue

The value to set for the second.

nanosecondValue

The value to set for the nanosecond.

Return Value

A new NSDate instance created with the given components, or nil if the components do not correspond to a valid date.

See Also

Calculating Dates

- dateFromComponents:

Returns a date representing the absolute time calculated from given components.

- dateByAddingComponents:toDate:options:

Returns a date representing the absolute time calculated by adding given components to a given date.

- dateByAddingUnit:value:toDate:options:

Returns a date representing the absolute time calculated by adding the value of a given component to a given date.

- dateBySettingHour:minute:second:ofDate:options:

Creates a new date calculated with the given time.

- dateBySettingUnit:value:ofDate:options:

Returns a new date representing the date calculated by setting a specific component of a given date to a given value, while trying to keep lower components the same.

- dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:

Returns a new date created with the given components base on a week-of-year value.

- nextWeekendStartDate:interval:options:afterDate:

Returns by reference the starting date and time interval range of the next weekend period after a given date.