How to add hours to an NSDate?

I’m not entirely sure what you are trying to do, but you can create an NSDate object by adding time in seconds on to another NSDate using:

- (id)dateByAddingTimeInterval:(NSTimeInterval)seconds

// eg. to add 8 hours to current time:

NSDate *mydate = [NSDate date];
NSTimeInterval secondsInEightHours = 8 * 60 * 60;
NSDate *dateEightHoursAhead = [mydate dateByAddingTimeInterval:secondsInEightHours];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)