Return to Snippet

Revision: 21043
at December 2, 2009 05:30 by funkypanda


Initial Code
// Get the Gregorian calendar
NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];

// Get the date
NSDate* now = [NSDate date];

// Get the hours, minutes, seconds
NSDateComponents* nowHour = [cal components:NSHourCalendarUnit fromDate:now];
NSDateComponents* nowMinute = [cal components:NSMinuteCalendarUnit fromDate:now];
NSDateComponents* nowSecond = [cal components:NSSecondCalendarUnit fromDate:now];

Initial URL


Initial Description


Initial Title
Get the Minutes, Hours, Seconds from NSDate and NSCalendar

Initial Tags
date

Initial Language
Objective C