Created
May 27, 2013 10:51
-
-
Save Kursulla/5656460 to your computer and use it in GitHub Desktop.
Break NSDate into components (dat, month, hour,....)
[Objective-C,ios,xcode,NSDate, NSDateComponents]
This file contains 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
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate:[NSDate date]]; | |
long showMonth=(long)[components month]; | |
long showDay=(long)[components day]; | |
long showYear=(long)[components year]; | |
long showHours=[[partsOfTime objectAtIndex:0] longLongValue]; | |
long showMinutes=[[partsOfTime objectAtIndex:1] longLongValue]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment