iOS create date in the future ignoring daylight savings
I'm trying to work with dates and create dates in the future, but daylight savings keeps getting in the way and messing up my times. Here is my code to move to midnight of the first day of the next month for a date: + (NSDate *)firstDayOfNextMonthForDate:(NSDate*)date { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; calendar.timeZone = [NSTimeZone systemTimeZone]; calendar.locale = [NSLocale currentLocale]; NSDate *currentDate = [NSDate dateByAddingMonths:1 toDate:date]; NSDateComponents *components = [calendar components:NSYearCalendarUnit |