NSDate *now = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *nowComponents = [gregorian components:NSYearCalendarUnit fromDate:now];
NSDateComponents *xmasComponents = [[NSDateComponents alloc] init];
[xmasComponents setDay:25];
[xmasComponents setMonth:12];
[xmasComponents setYear:[nowComponents year]];
NSDate *xmas = [gregorian dateFromComponents:xmasComponents];
int ttx = (int) ([xmas timeIntervalSinceDate:now] / (24 * 60 * 60)) + 1;
NSLog(@"%d", ttx);
[xmasComponents release];
[gregorian release];
segunda-feira, abril 20, 2009
Subscrever:
Enviar feedback (Atom)
Sem comentários:
Enviar um comentário