I would like to subtract 4 hours from a date. I read the date string into an NSDate object use the following code:
NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
NSDate * mydate = [dateFormatter dateFromString:[dict objectForKey:@"published"]];
What do I do next?
NSDate *newDate = [theDate dateByAddingTimeInterval:-3600*4];
NSDate *newDate = [[[NSDate alloc] initWithTimeInterval:-3600*4
sinceDate:theDate]] autorelease];