How can i format a string like "Fri Oct 17 00:00:00 +0200 2003" to a simple date string like Fri Oct 17 2003?
Is there any easy solution?
How can i format a string like "Fri Oct 17 00:00:00 +0200 2003" to a simple date string like Fri Oct 17 2003?
Is there any easy solution?
Yes, use the NSDateFormatter
to parse the first into an NSDate and then use another NSDateFormatter
to write out that NSDate
in the second format.
You can find a list of the date format specifiers here: Unicode Date Formats