I'm trying to get the NSDate
from a string with the following format 'YYYY-MM-ddTHH:mm:ssZ' using the NSDateFormatter
. The NSDateFormatter
returns always nil
. Here is how I tried to do that:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
NSDate *dateFromString = [dateFormatter dateFromString:@"2013-08-09T18:30:00+02:00"];
that would be a better formatter.
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With