How to convert NSDate in to relative format as “Today”,“Yesterday”,“a week ago”,“a month ago”,“a year ago”?
问题 I want to convert nsdate in to relative format like "Today","Yesterday","a week ago","a month ago","a year ago","date as it is" . I have written following method for it.. but some how its just printing as it is date.. can you please tell me what should be the problem? //Following is my function which converts the date into relative string +(NSString *)getDateDiffrence:(NSDate *)strDate{ NSDateFormatter *df = [[NSDateFormatter alloc] init]; df.timeStyle = NSDateFormatterMediumStyle; df