Here is my code:
The variables:
let date = Date()
let calendar = Calendar.current
let hour = calendar.component(.hour, from:date)
let minute = calendar.component(.minute, from:date)
let second = calendar.component(.second, from:date)
Then this is where I display it in a label:
time.text = "\(hour):\(minute):\(second)"
It is showing up as 19:1, not sure if that is 24hr or UTC or whatever.
First of all, how do I get it to display: 19:01, and second, how do I make it display it is 12 hour time, so 7:01 ?
Thanks in advance!