ios - NSDateFormatter dateFromString returns nil for MM/dd/yyyy -
I am using the same why In case of date above, does the format return to Neil? You are using the wrong format: You need to use your You've got the correct format set on nsdateformatter style and string in many apps and functions but There is a function called the background thread, and when I apply the break point, then
NSDate becomes
zero when I use the
datefromstring
NSString * start = [dataDict objectForKey: @ "start_date"]; NSString * end; If (! [[Data Dict objectForKey: @ "end_date"] is EqualToString: @ ""]) {end = [dataet object object: @ "end_date"]; } Other {end = [statistics data item: @ "estimate_and_date"]; } NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; [Format setDateFormat: @ "yyyy"]; // NSLocale * enUSPOSIXLocale = [[NSLocale alloc] // initWithLocaleIdentifier: @ "en_US_POSIX"]; // emphasis (enUSPOSIXLocale! = Zero); // [Format SettleCell: NUSPOSISSXLocalay]; // [Formator set time zone: [NSTimeZone timeJoinfire seconds from GMT: 0]]; NSDateFormatter * detailformatter = [[NSDateFormatter alloc] init]; [Details: setDateFormat: @ "MM / dd / yyyy"]; NSDateComponents * dateComponents = [NSDateComponents new]; DateComponents.year = Year; NSDate * newDate = [[NSCalendar current calendar] dateByAddingComponents: dateComponents toDate: _earliestDate options: 0]; NSString * Plain serial yer string = [formatter string string: newadet]; NSDT * Plain Serial DirectDate = [Formatter Debt Frostring: Pledanchrint YeerString]; NSDate * startDatePlain = [date of the format of the frame: start]; NSDate * endDatePlain = [formatter dateFromString: end];
NSDateFormatter * Formatter = [[NSDateFormatter alloc] init]; [Format setDateFormat: @ "yyyy"]; NSDate * startDatePlain = [date of the format of the frame: start]; NSDate * endDatePlain = [formatter dateFromString: end];
detailformatter :
NSDateFormatter * detailformatter = [[NSDateFormatter alloc] init]; [Details: setDateFormat: @ "MM / dd / yyyy"]; NSDate * startDatePlain = [detailformatter dateFromString: start]; NSDate * endDatePlain = [detailformatter dateFromString: end];
detailformatter !
Comments
Post a Comment