NSDate *date=[NSDate date];
NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
formatter.dateFormat=@"yyy-MM-dd HH:mm:ss";
NSString *str=[formatter stringFromDate:date];
字符串转化时间
NSString *time=@“2011/02/10 18:34”;
NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
formatter.dateFormat=@"yyy-MM-dd HH:mm:ss";
NSDate *date=[formatter dateFromString:date];