I understand how to use an NSDateFormatter
to convert a month component into a long name string, but how does one convert a month name to an int
?
I've been using a switch statement to convert, but I'm thinking there must be a simpler way.
For example, I'd like to convert "May" to 5.