I have a date as a string in the format:
2010-12-31 20:21:00 +0200
What I’d like to do is parse this using NSDateFormatter to an NSDate object but I’m having difficulty matching the format properly.
NSDateFormatter *dateFormatter = NSDateFormatter.alloc.init;
[dateFormatter setTimeZone: NSTimeZone.localTimeZone];
[dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss'Z'"];
[dateFormatter dateFromString: @"2010-12-31 20:21:00 +0200"] // returns nil ;
Can anybody help me find the correct format? thanks
This code works:
And I just want you to know, kind sir, that my eyes bleed when I see this
NSDateFormatter.alloc.init