Reputation: 725
I am currently using an NSDateFormatter on my application to show the date in the format that i want. My NSDateFormatter looks like this : [formatter setDateFormat:@"MMM dd, yyyy hh:mm"];
which would give me dates like : Sep 02 , 2012 08:30
.
I have 2 questions. i want to show the time in military time how can i do that with the formatter? I know how to show the AM/PM but i would like the time above to look 20:30. Secondly how can i make the month appear as a number? September would be 09 .
Upvotes: 1
Views: 178
Reputation: 4725
This site has a nice table with the format specifiers you can use, follow up from that.
In this case, you should use [formatter setDateFormat:@"MM dd, yyyy HH:mm"];
To get 09 02, 2012 20:30
Upvotes: 3