Hi,
From an API I'll get a datetime in the format 2015-09-25T09:45:00+02:00.
What can I do calculate the minutes between the current datetime and the datetime from the API.
This is what I have, but didn't work:
(...)
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss"];
NSDate *lastDate = [format dateFromString:beginTijden[0]];
NSDate *todaysDate = [NSDate date];
NSTimeInterval lastDiff = [lastDate timeIntervalSinceNow];
NSTimeInterval todaysDiff = [todaysDate timeIntervalSinceNow];
NSTimeInterval dateDiff = lastDiff - todaysDiff;
(...)Please help me.
Thanks 🙂