// create a DateFormatter object to format date/time
let myDateFormat = DateFormatter()

// custom date/time format example
myDateFormat.dateFormat = "yyyy-MM-dd HH:mm:ss"
print(myDateFormat.string(from: now))
// 2019-09-03 14:29:17

// to confirm current timezone
print(myDateFormat.timeZone!)
// America/Los_Angeles (current)