I am very new to Objective C.
I am passing date in the format "YYYY-MM-DD" from webservice to apps (Objective C). How do I convert this to date format in Objective C?
Some help would be appreciated. :)
Regards, SG
I am very new to Objective C.
I am passing date in the format "YYYY-MM-DD" from webservice to apps (Objective C). How do I convert this to date format in Objective C?
Some help would be appreciated. :)
Regards, SG
You can use "dateFromString" function as below:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [formatter dateFromString:@"2012-02-06"];
[formatter release];