Currently I'm working on NSDate
and NSDateFormatter
.
My issue is I need to find the date after 100 days
of the user specified date.
Currently I'm using this hard-coded string for finding a future date.
calendar.maximumDate = [self.dateFormatter dateFromString:@"20/08/2015"];
But it is not correct way and not work with user specified date. Is there anyway to achieve this ?
Please help me.
Thanks in advance.
Use
dateByAddingTimeInterval
function inNSDate
. LikeLike this:
Try the following
use nsdate instance method "- (id)dateByAddingTimeInterval:(NSTimeInterval)seconds" and pass (100 * 86400) as argument to get the date after 100 days from the user specified date. Call this method using user specified date which is instance of nsdate.
Here's an example: