I would like to display the time of the current date in a UILabel in the current locale. Assuming the current time would be 15:30 (24 hours display) / 3:30 PM (12 hours display). Now, if the current locale of the user is 12 hours display, the label should only show "3:30", and the "PM" should display in a second label. I intended to use
someDateTime = Date()
let df = DateFormatter()
df.locale = Locale.autoupdatingCurrent
df.timeStyle = .short
timeLabel.text = df.string(from: someDateTime) // how without AM/PM ?
ampmLabel.text = "???" // how to show only in 12 hours regions?
But in 12 hours regions it comes always with the AM/PM attached to it. How could I easily distinguish these cases?