Return to Snippet

Revision: 34145
at February 9, 2011 04:11 by rabc


Updated Code
NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSUInteger unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSDayCalendarUnit;
NSDateComponents *components = [gregorianCalendar components:unitFlags
					fromDate:todaysDate
				        toDate:lastDate
					options:0];
[gregorianCalendar release];

NSString *days = [components day];

Revision: 34144
at October 18, 2010 07:44 by rabc


Initial Code
NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSUInteger unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSDayCalendarUnit;
SDateComponents *components = [gregorianCalendar components:unitFlags
					fromDate:todaysDate
				        toDate:lastDate
					options:0];
[gregorianCalendar release];

NSString *days = [components day];

Initial URL

                                

Initial Description

                                

Initial Title
Days between two dates (datediff)

Initial Tags
iphone

Initial Language
Objective C