Skip to content

Instantly share code, notes, and snippets.

@Eridana
Created March 31, 2015 10:25
Show Gist options
  • Save Eridana/0f76c7d1bf1026222b52 to your computer and use it in GitHub Desktop.
Save Eridana/0f76c7d1bf1026222b52 to your computer and use it in GitHub Desktop.
Get "Today" or "Yesterday" from NSDate
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ru_RU"];
[dateFormatter setLocale:locale];
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
dateFormatter.doesRelativeDateFormatting = YES;
_dateAsString = [dateFormatter stringFromDate:_date];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment