Reputation: 479
My app has two languages .. Arabic and English ..
And am getting todays date like this:
var todaydate = ""
var today = Date()
var formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
todaydate = formatter.string(from: today)
this returns in English:
2018-06-04
and in Arabic:
٢٠١٨-٠٦-٠٤
I want to be always in English numbers like 2018-06-04
How to do that?
Upvotes: 3
Views: 1026
Reputation: 100503
Can you try setting local
formatter.locale = Locale(identifier: "en")
Upvotes: 1