unsigned int flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
NSCalendar* calendar = [NSCalendar currentCalendar];
NSDateComponents* components = [calendar components:flags fromDate:date];
NSDate* dateOnly = [calendar dateFromComponents:components];
date
is the date you want to remove the time from.
This separates the date and time and creates a new date with the default time (00:00:00).
EDIT
To take time zone into account:
NSDate* dateOnly = [[calendar dateFromComponents:components] dateByAddingTimeInterval:[[NSTimeZone localTimeZone]secondsFromGMT]];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…