String to nsdate from Swift

I have a string containing a date in this format:
Thursday, September 4, 2014 10:50:12 0000

Do you know how to convert it to:
April 9, 2014
(DD-MM-YYYY)

Of course, use Swift
Thank you

If the above method does not work, this should solve the problem:

let formatter = DateFormatter()
formatter.locale = Locale(identifier: "US_en")
formatter.dateFormat = "E, dd MMM yyyy HH:mm:ss Z"
let date = formatter.date(from: "Thu, 04 Sep 2014 10:50:12 +0000")

I have a character containing a date in this format String:
Thursday, September 4, 2014 10:50:12 0000

Do you know how to convert it to:
April 9, 2014
( DD-MM-YYYY)

Of course, use Swift
Thank you

If the above method does not work, this should be solved Question:

let formatter = DateFormatter()
formatter.locale = Locale(identifier: "US_en")
formatter.dateFormat = " E, dd MMM yyyy HH:mm:ss Z"
let date = formatter.date(from: "Thu, 04 Sep 2014 10:50:12 +0000")

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4146 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.