I'm trying to convert the current time and date to a timestamp format. Since the service is receiving this format for timestamps:
2018-26-11T11:38:00Z
I decided to use a format like this:
yyyy-M-dd'T'H:mm:ss'Z'
But, when I use a date formatter to convert it, I'm getting an unwanted AM/PM tag at the end by default:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-M-dd'T'H:mm:ss'Z'"
let currentTimeAndDate = Date()
let timeStamp = dateFormatter.string(from: currentTimeAndDate)
// Prints "2018-12-05T12:58:38 PMZ"
How can I remove that AM/PM by default at the end of the string?