我必须从 Date 发送 DDMMYYY 日期才能与 API 通信。
NSDateComponents *dateComponents; NSCalendar *gregorian; NSDate *日期;
gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
dateComponents = [[NSDateComponents alloc] init];
self.date = [gregorian dateByAddingComponents:dateComponents toDate:[NSDate date] options:0];
我必须使用 [dateComponents day] 等吗?是否有一些方法可以帮助我像在 PHP 中那样执行该任务?