openfrog
openfrog

Reputation: 40735

How to determine programmatically if current locale uses AM/PM or 24h format for time?

I have a 24h formatted time string like 13:30 which I must translate into a 12h time format string when the user's locale uses AM/PM. How can I detect that reliably?

Upvotes: 3

Views: 2856

Answers (1)

Darren
Darren

Reputation: 10398

There's a few methods. See my question here Detect iPhone 24-Hour time setting Basically you set a time and check the string for am or pm

Upvotes: 4

Related Questions