How can I create an NSDate
from the day, month and year? There don\'t seem to be any methods to do this and they have removed the class method dateWithString<
A slightly different answer to those already posted; if you have a fixed string format you'd like to use to create dates then you can use something like:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [NSLocale localeWithIdentifier:@"en_US_POSIX"];
// see QA1480; NSDateFormatter otherwise reserves the right slightly to
// modify any date string passed to it, according to user settings, per
// it's other use, for UI work
dateFormatter.dateFormat = @"dd MMM yyyy";
// or whatever you want; per the unicode standards
NSDate *dateFromString = [dateFormatter dateFromString:stringContainingDate];