简单类型 / 日期和时间

NSDate *now = [NSDate date];

NSString *shortStyle = [
                        NSDateFormatter localizedStringFromDate:now dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle];
//shortStyle is "6/22/15, 4:10 PM"

NSDateFormatter *dateFormatter = [NSDateFormatter new];
dateFormatter.dateFormat = @"yyyy-MM-dd";
NSString *customStyle = [dateFormatter stringFromDate:now];
//customStyle is "2015-06-22"