In the images below you can see the code I wrote and the values of all the variables:
class fun getCurrentShortDate() -> String {
var todaysDate = NSD
Here's the way Apple suggests
let formatter = DateFormatter()
formatter.locale = Locale.current
formatter.dateStyle = .short
let dateString = formatter.string(from: date)
or if the pre-defined format of .short, .medium, .long and .full are quite right create the template in a locale
let formatter = DateFormatter()
formatter.locale = Locale.current
formatter.setLocalizedDateFormatFromTemplate("MM/dd/yyyy")
let dateString = formatter.string(from: date)
Here's the link