Article # 99, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Choosing between 12-hour and 24-hour format.
Q. How do I tell if the user prefers their time display in 12-hour or 24-hour format? A. Call LocalGetDateTimeFormat(buffer, DTF_HM) and do some analysis on the returned string. The string will look something like this: |HH|:|Zm| |AP| or |Zh|:|Zm| The first string is for 12 hour time format, the second is for 24 hour. If you scan the string for "AP" and find it, that means the format is 12 hour. You probably don't want to try checking for "Zh" since that is not a guarantee that the format is 24 hour. This all assumes the user hasn't mangled the time format via the Preferences application. However, ever since the OmniGo we don't allow the user that kind of flexibility.