I keep seeing on code reviews that people are instantiating NSDateFormatter whenever they need it, and releasing it shortly afterwards. And then raising questions, why their code is so slow. Well,

[[NSDateFormatter alloc] init] 

is very pricey. You may do not notice it in the simulator but on the real device it has very high price. So, cache it whenever possible. Use static class variable

@implementation SomeClass

// I recommend using separate date formatter for differents formats. You can have as many of them as you want
static NSDateFomatter *dateFomatter1 = nil;
static NSDateFomatter *dateFomatter2 = nil;

- (void)initialize { // will run only once on the first instantiation of the SomeClass
    dateFormatter1 = [NSDateFormatter alloc] init];
    [dateFormatter1 setDateFormat:@"yyyyMMdd HH:mm:ss.SSS"]; // set to whatever you need
 dateFormatter2 = [NSDateFormatter alloc] init];
    [dateFormatter2 setDateFormat:@"yyyyMMdd"]; // set to whatever you need


or an ivar,

@implementation SomeClass {
    NSDateFomatter *_dateFomatter;

- (NSDateFormatter *)dateFormatter { 
    // we will do so-called lazy initialization here
 if (!_dateFormatter) {
        _dateFormatter = [NSDateFormatter alloc] init];
        [_dateFormatter setDateFormat:@"yyyyMMdd HH:mm:ss.SSS"];
    return _dateFormatter;

- (void) someCode {
    NSString *strDate = [[self dateFormatter] stringFromDate:someDate];

- (void) dealloc {
    [_dateFormatter release];


it doesn't matter. Just cache it, whenever you stumble upon it in the code. Do not think of it as of premature optimization, the matter of fact is that you'll have to cache it in the future.