let myDateFormat = DateFormatter()
let now = Date()
myDateFormat.dateStyle = .medium
myDateFormat.timeStyle = .none

myDateFormat.locale = Locale(identifier: "en_US")
print(myDateFormat.string(from: Date()))    // Oct 5, 2021

myDateFormat.locale = Locale(identifier: "fr_FR")
print(myDateFormat.string(from: Date()))    // 5 oct. 2021

myDateFormat.locale = Locale(identifier: "ja_JP")
print(myDateFormat.string(from: Date()))    // 2021/10/05