Is it possible to add custom text in NSDateFormatter’s format string?

You can insert arbitrary text (enclosed in single quotes) in the date format, for example.

NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
[fmt setDateFormat:@"dd' in the month of 'MMMM' in the year of 'yyyy"];
NSString *s = [fmt stringFromDate:[NSDate date]];

Result:

09 in the month of July in the year of 2013

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)