I have a String with a datetime format: \"YYYY-MM-DD HH:MM:SS\".
I use this in my source code:
NSDateFormatter *formatter = [[[NSDateFormatter alloc]
You want to use [NSFormatter dateFromString:] to convert your string-based date to an NSDate instance. From there you want to use stringFromDate with the NSDate, not the string as you have written above. I'm not sure about using the same NSDateFormatter for both parsing and formatting - you may need two separate instances to handle the different format styles.