Safari
Safari

Reputation: 11935

NSDate to string with format weekday numberday

how can i get a string with this format date: "Sunday 24"? with this code

NSDate *startTime = [NSDate date];
NSDateFormatter *formatDate = [[NSDateFormatter alloc] init];
[formatDate setTimeStyle:NSDateFormatterMediumStyle];
[formatDate setDateFormat:@"EEEE dd"];
NSString *date = [formatDate stringFromDate:startTime];

i have

"sunday 24"

how can i get a capital letter?

Upvotes: 0

Views: 1088

Answers (1)

EmptyStack
EmptyStack

Reputation: 51374

You should capitalize it explicitly.

NSString *date = [[formatDate stringFromDate:startTime] capitalizedString];

Upvotes: 2

Related Questions