IOS 数字日期转化为字符串
View Code
+ (NSString *)dateIntToDateStr:(NSInteger)dateInt { int year = dateInt / 10000; int month = dateInt % 10000 / 100; int day = dateInt % 100; NSString *date = [NSString stringWithFormat:@"%d-%d-%d", year, month, day]; NSLog(@"date is %@",date); return date; } 输入:20130129 输出:2013-1-29