user773578
user773578

Reputation: 1161

Custom NSDate DDMMYYYY

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

Answers (1)

Joris
Joris

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

Related Questions