I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00".
Besides, I want to get a localized time string. For example, in Chinese, I want to get "下午10:00" instead of "10:00 PM". So I have to use the [NSLocale currentLocale], and can't use the en_US_POSIX locale.
Please help me to get a localized 12-hour format time string.
I need not only the hour part, and also the am/pm part. Besides, am/pm part may locate before the hour/minute part or after the hour/minute part depending on locale. Just like the system display time. When system is set to use 12-hour format, it's just simple. But when the system is using 24-hour format, I just can't get the localized 12-hour format time string.