Created
February 24, 2014 05:31
-
-
Save keicoder/9182453 to your computer and use it in GitHub Desktop.
objective-c : basic NSDateFormatter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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