这是我用来更改日期格式的代码
NSLog(@"newBirthDates%@",_newwBirthDates);
NSDateFormatter *Form = [[NSDateFormatter alloc] init];
[Form setDateFormat:@"MM/dd"];
NSDate *date1 =[NSDate date];
NSString *string =[Form stringFromDate:date1];
NSLog(@"string%@",string);
NSDate *todaydate =[Form dateFromString:string];
NSLog(@"todaydate%@",todaydate);
这就是我得到的输出
newBirthDates(
"05/22",
"07/11",
"10/07",
"02/20"
)
newBirthDates(
"05/22",
"07/11",
"10/07",
"02/20"
)
string03/18
todaydate1970-03-17 18:30:00 +0000
现在我的问题是为什么 3/18 变成 03/17?为什么一天会减少