I have this date string:
2014-03-09T00:00:00+01:00
Tried to parse it to timestamp using this code:
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-mm-dd'T'HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:response];
NSLog(@"%@", date);
NSTimeInterval timestamp = [date timeIntervalSince1970];
But it always returns nil in NSLog
. What is the proper dateFormat for my date string?
I use same date format in Android app and it works but does not in Obj-C.