Reputation: 1161
I want to grab a date entered by the user, but only the day, month and year.
How is this done with a dateformatter?
Is it possible to create a date without hours, minutes, seconds?
How would this custom date be compared with to other dates?
Upvotes: 0
Views: 342
Reputation: 6296
out of the top of my head:
NSString * myString = @"23/11/1990";
NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"dd/MM/yyyy"];
NSDate * date = [formatter dateFromString:myString];
Upvotes: 1