iOS: 24 hour time formatting not honored with Region=Canada, Language=French

251 Views Asked by At

If Language is French and Region is Canada, the Languge & Region pane in Settings shows 24 hour time formatting in the sample area as expected, as does the rest of iOS and stock apps.

But if I create a simple SwiftUI app, 12 hour AM/PM formatting is still used.

struct ContentView: View {
    var body: some View {
        VStack {
            Text("hourCycle: \(Locale.current.hourCycle.rawValue)")
            Text(Date.now.formatted())
        }
        .padding()
    }
}

screenshot showing AM/PM in time

If I set language to English and region to United Kingdom or other 24 hour time region, I get 24 hour formatting as expected:

screenshot showing 24 hour time in time

If I use DateFormatter I see the same issue. Note that English-Canada uses AM/PM.

Is this developer error (me!) or a bug in iOS? I tried iOS15 (removing Locale.current.hourCycle as this is iOS16 only) and see the same issue.

Settings: enter image description here

0

There are 0 best solutions below