So I have this problem, I have a String that is Jueves 10 Junio 1990, it is in a es_MX locale, I want to convert that into a NSDate with en_US as the new locale.
This is my code:
let myString:String = "Jueves 10 Junio 1990"
let dateFormatter = NSDateFormatter()
dateFormatter.locale = NSLocale(localeIdentifier: "en_US")
dateFormatter.dateFormat = "EEEE dd MMMM yyyy"
let finalDate:NSDate = dateFormatter.dateFromString(myString)!
let finalString = dateFormatter.stringFromDate(date)
I was waiting that finalString resulted as Thursday 10 June 1990.
The problem here is that finalDate results as a nil value.
Is my code wrong? How can I achieve this?
Thanks in advance.
