苹果 ios----把NSDate只精确到天

 NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];

        [formatter setDateFormat:@"yyyy/MM/dd"];

        NSString *dateStr = [formatter stringFromDate:nowDate1];

        nowDate1 = [formatter dateFromString: dateStr];

        NSLog(@"%@",nowDate1);

你可能感兴趣的:(苹果 ios----把NSDate只精确到天)