Last active
December 10, 2015 06:28
-
-
Save bendytree/4394718 to your computer and use it in GitHub Desktop.
Example of OKDate
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
| // create a date | |
| OKDate* a = [OKDate dateWithNumbers:@[2013, 6, 16, 8, 0, 0]]; | |
| [a addDays:2]; //add 2 days | |
| a.minute = 30; //set minutes to 30 | |
| // render to "2013-06-18 8:30AM" | |
| NSString* b = [a format:@"yyyy-MM-dd H:mma"]; | |
| // parse a date | |
| OKDate* c = [OKDate parseDate:@"2013-01" format:@"yyyy-MM"]; | |
| // render a date to ISO8601 standard | |
| NSString* d = [c iso8601]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment