Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created February 24, 2014 05:31
Show Gist options
  • Select an option

  • Save keicoder/9182453 to your computer and use it in GitHub Desktop.

Select an option

Save keicoder/9182453 to your computer and use it in GitHub Desktop.
objective-c : basic NSDateFormatter
//basic NSDateFormatter
#pragma mark - updateDueDateLabel
- (void)updateDueDateLabel {
//to convert the NSDate value to text, use the NSDateFormatter object
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
self.dueDateLabel.text = [formatter stringFromDate:_dueDate]; //NSDate *_dueDate for local notifications
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment