我正在尝试从本月的第一天获取 NSDate 对象。我使用以下代码:
NSDateComponents *components = [c components:(NSEraCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekdayOrdinalCalendarUnit | NSDayCalendarUnit) fromDate:[NSDate date]];
components.day = 1;
NSDate *dayOneInCurrentMonth = [c dateFromComponents:components];
但是,当我记录此日期时,它会给我前一天
day one = 2013-09-30 22:00:00 +0000