I am currently extacting yyyy mm dd hh mm and ss from NSDate like this:-
NSDate* dd = [NSDate date];
NSString* date = [dd description];
NSString* y = [date substringToIndex:4];
NSString* m = [[date substringFromIndex:5] substringToIndex:2];
NSString* d = [[date substringFromIndex:8] substringToIndex:2];
NSString* h = [[date substringFromIndex:11] substringToIndex:2];
NSString* mi = [[date substringFromIndex:14] substringToIndex:2];
NSString* s = [[date substringFromIndex:17] substringToIndex:2];
NSLog(@"%@, %@ %@ %@ %@ %@ %@,", date, y, m, d, h, mi, s);
But it seems dodgy to me e.g. what about locale? Is there a better way to do it, or is this locale-proof?