The best way is this library . βΊ
I have to add the link to this page to the Bitbucket repository , which contains the newer source code (including 32-bit and Clang fixes!) And there is an error tracker. If you find any other errors in it, write them.
I would also like to know what you mean by "more complex than necessary." Normal use is very simple:
ISO8601DateFormatter *formatter = [[[ISO8601DateFormatter alloc] init] autorelease]; //Or, if you prefer, create it once in -init and own it until -dealloc NSDate *parsedDate = [formatter dateFromString:inString]; NSString *unparsedString = [formatter stringFromDate:inDate];
You can disable dateFromString:
or stringFromDate:
for one of the longer methods if you need additional information (for example, to save the time zone).
If you mean something else, I want to hear it to improve the library.
Peter Hosey
source share