I have saved a date in @”dd-MM-yyyy HH:mm:SS” format,Now in database it gets displayed in what ever format specified! But I have a requirement of displaying date in view reminder page.Hence I would like to display date in such a way that the visibility of date is simple in appearance.
Hence I would like to have the date with say the format:January 23 or August 19 etc…
I have tried the below code but its not displaying any date:
remin.Date = [[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statament, 3)]autorelease];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init];
[dateFormat setDateFormat:@"MMMM-dd"];
NSDate *date = [dateFormat dateFromString:remin.Date];
NSString *dateVal = [dateFormat stringFromDate:date];
remin.Date = dateVal;
Please provide a solution through your valuable suggestions
Thanks in advance 🙂
Try the following code