Swift

let currentDate = Date()
let dataFormatter = DateFormatter()
dataFormatter.locale = Locale(identifier: "zh_Hant_TW")
dataFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
let stringDate = dataFormatter.string(from: currentDate)

Categorized in: