let d = "Wed Jul 01 04:48:51 +0000 2015"
let formatter = NSDateFormatter()
formatter.dateFormat = "EEE MMM dd HH:mm:ss Z yyyy"
if let date = formatter.dateFromString(d) {
formatter.dateFormat = "yyyy-MM-dd"
let dateString = formatter.stringFromDate(date)
println(dateString) // "2015-07-01"
}