خرید بک لینک

Vote count: 0

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.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 28 خرداد 1395 ساعت: 6:20

صفحه بندی