我正在使用NSDateFormatter将字符串转换为NSDate
1 NSDateFormatter *df = [[NSDateFormatter alloc]init];
2 [df setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
3 [df setDateFormat:@"YYYY-MM-dd"];
4 NSDate *dueDate = [df dateFromString:@"1970-01-01"];
当我检查dueDate时,错误一年:
po dueDate
(NSDate *) $0 = 0x1cdc08d0 1971-01-01 00:00:00 +0000
我这样做是错误的还是可能与“请勿打扰”功能中的错误相同?