Reputation: 2121
I try to convert a string to NSDATE with no luck unfortunately.
Friday, October 22, 11:26:45 ET 2010
I know the options for formatting (http://sree.cc/objective-c/nsdate-format-string-in-objective-c) but i cant get it to work.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"???????"];
anyone?
Upvotes: 3
Views: 1431
Reputation: 243146
So you'd probably need something like:
[dateFormatter setDateFormat:@"eeee, MMMM dd, HH:mm:ss z yyyy"];
eeee
- Local day of week spelled outMMMM
- Month spelled outdd
- day of month with no leading zerosHH
- hour of day (24 hour format)mm
- minutes of hour (with leading zero)ss
- seconds of minute (with leading zero)z
- timezone (short wall time)yyyy
- calendar yearUpvotes: 5